I've just started to look into MVC and I'm pretty new. I would like to port procedural code across to it but I'm struggling (please no-one suggest to use a Framework).
I can understand how it works, but understanding is different to doing. In my procedural code, I have several functions such as message(). These are called if the user does not have permission to view the current page, for example.
My problem is adding this into MVC. I've added Twig so far and I've managed to render some Twig on the index page but using functions such as message before was as easy as this:
message('Message Text');
Adding it to the controller directory would allow it to be accessed as a web page, which I don't want. And through the model, I'm not sure how to do this without requiring the file first. I could use a function, but I don't want globals and this is partly why I'm changing.
How can I properly place commonly used functions?
Edit
What I'm using is a modified version of this: http://www.phpro.org/tutorials/Model-View-Controller-MVC.html