Helpers and models


I’m trying to follow the rule that every piece of logic must remain in the MODEL, not in the handler nor in the view. But the MODEL doesn’t have access to a lot of functionality – which, of course, I understand, as we have to encapsulate code and we can’t depend on external functions for it to work.

So, I’m importing the webService plugin and other functionality to the model via the DEPENDENCY injections. But how can I do that with the helpers? It doesn’t seem very logic to me that the functions in the helpers directory aren’t exposed to the MODEL as they’re very useful, for example in field validation, etc.

Am I getting everything wrong?

Thanks again in advance for all support from this group,

Fernando S. Trevisan (Programador)