Get current URL in Twig template?

{{ path(app.request.attributes.get(‘_route’), app.request.attributes.get(‘_route_params’)) }} If you want to read it into a view variable: {% set currentPath = path(app.request.attributes.get(‘_route’), app.request.attributes.get(‘_route_params’)) %} The app global view variable contains all sorts of useful shortcuts, such as app.session and app.security.token.user, that reference the services you might use in a controller.

How to render a DateTime object in a Twig template

Although you can use the {{ game.gameDate|date(‘Y-m-d’) }} approach, keep in mind that this version does not honor the user locale, which should not be a problem with a site used by only users of one nationality. International users should display the game date totally different, like extending the \DateTime class, and adding a __toString() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)