Tag: symfony twig
-
Symfony 5+ how to import or link to javascript and css files with webpack encore
Symfony has a handy way of importing your css and javascript files into your templates/pages to use them. You can find the full info in the docs link here. This was a little confusing to me at first. Mostly due to my lack of knowledge of some of the Webpack and modern JS features like…
-
Symfony 5+ check if user is logged in inside a twig template
Often you may need to know whether a user is logged in or not inside a template to show or not show something. For example you might want to show links to login or register if a user is not logged in but show a link to logout if the user is logged in. To…