Re: Where to place code meant to be universally accessible?

2011-08-12 Thread Miles J
That's not what models are for. Models are meant to represent an entity of data from a datasource (database or rest), not to convene helper methods. Cake creates even more confusion because their model system isn't a true model system, it's simply a DAO (database access object). On Aug 11, 3:42 

Re: Where to place code meant to be universally accessible?

2011-08-12 Thread Burningfuses
I opted to go by Miles' suggestion and created a static class in vendors. So far it is working great. Thanks a lot for all the help guys. Best, Burningfuses On Aug 12, 2:17 pm, Miles J mileswjohn...@gmail.com wrote: That's not what models are for. Models are meant to represent an entity of

Where to place code meant to be universally accessible?

2011-08-11 Thread BurningFuses
In my app I have a bunch of time related routines that I want to be able to call from my controllers and models. I could turn them into a component so they could be accessible on all my controllers, but they wouldn't be (in a trivial way or recommended way) be accessible from my models. Where

Re: Where to place code meant to be universally accessible?

2011-08-11 Thread euromark
usually in the model since controllers can easily access models but that depends on your situation maybe a lib, maybe a behavior, maybe some boostrap code without knowing more details, i go for model code On 11 Aug., 22:30, BurningFuses cassi...@gmail.com wrote: In my app I have a bunch of

Re: Where to place code meant to be universally accessible?

2011-08-11 Thread Miles J
Create a static class and place it in libs or vendors. On Aug 11, 2:09 pm, euromark dereurom...@googlemail.com wrote: usually in the model since controllers can easily access models but that depends on your situation maybe a lib, maybe a behavior, maybe some boostrap code without knowing

Re: Where to place code meant to be universally accessible?

2011-08-11 Thread Stephen Latham
I agree the model is a good place. I recently wrote these type of global actions in the app controller rather than bootstrap.php but found after thought and discussion the model made more sense. On 11 Aug 2011, at 22:09, euromark dereurom...@googlemail.com wrote: usually in the model