I have read about Kirby controllers. It’s nice to have functions attached to a template.
Are there any shared controllers? What I mean is a controller that are used by more than one template.
An example:
A function to be put, for example in a controller.
function widget() {
echo 'Do this in my sidebar';
}
…used by…
/blog/a-post
/blog/a-post2
/home
Home and blog are different template files. I could duplicate code or have it in a plugin. Should I not use controllers for shared functions?