Controller for all the pages

Hi everyone! Iā€™m editing a snippet trying to make a login form that is present in all pages in the header. Is possible to have something like a controller that contains logic away from templates but works in all the site?

thanks in advance!

1 Like

You only need to point your form to a particular page URL in the action attribute; the logic would then go into the controller for that page. You could even use a route for that purpose (instead of a controller).

thanks! but what happens when i put the url on the action of the form it redirects me to that page.