What's the best practice for placement of functions that are used across multiple MVC layers?
I've recently had to write some statistics functions that are used both in the View and the Model. If I put them in a helper, I'm stuck loading helpers in the model layer, which is annoying, seems incorrect, and breaks completely when those functions are called from a task (because there is no default context). If I put them in the top level lib
directory, I'm stuck making calls like Stats::normalPercentile
in the view.
Are there any other options? Are there any comments from Symfony devs on where functions like these should be placed?
Edit: Apparently there's no issue with making static calls in views. I inferred this based on Symfony not writing their helpers as classes (even after significant discussion.) In that case, are there any conventions for placing files like these? Just throw them in lib/util
?