Hey I am trying to make a href with current year and month, sent with get request to a controller function this way <a href="{{ path('transactions', {'year' : date("Y"), 'month' : date("n")}) }}"></a> and im getting "An exception has been thrown during the rendering of a template ("Warning: preg_match() expects parameter 2 to be string, object given")."
I assume that I am getting an object instead of string but I have no clue how to overcome it and I didn't found any reasonable way to solve it.
$date = new DateTime('2000-01-01'); $result = $date->format('Y-m-d H:i:s');like$date->format('y')for the year and so on.