Confused about controllers

I have a form on a template named contact so I create a controller named contact - works great, but what if I want a form in the footer of every page - how do I link the controller?

You can either put the logic into the form snippet, or you use a route to handle the form logic.

Can probably use a shared controller too

The downside of this approach is that you probably have to integrate the shared controller into many dedicated controllers.

cheers, so i can just chuck the php code in a snippet? what’s the advantage of using a controller then?

Basically, separation of concerns.

1 Like