I have a Symfony2 Web application which requires user login to perform such useful operations. In Symfony, you can put a link to the login page and then the security handled by the framework do the rest. You have to define the route for the login page in the security.yml configuration file.
I want to know if is it possible and how to let the user log in each page of the site (e.g. by inserting the login form on top of the page). This will save a page load and will not bother users.
Thanks in advance
The best way to do this is to have all your templates extend a base template. I.E, in all your Twig templates have something like
In base.html.twig render a controller which renders the login form. To do this, in base.html.twig do something like:
Then create a controller action, something like:
And finally in your loginForm.html.twig render the form.