Thursday, March 22, 2012

Re: Where to save utility routines

If you also need to use it outside of the view, you can just create a static class and include it, then use the methods statically in the view.

SomeClass::staticMethod().

On Wednesday, March 21, 2012 12:01:20 PM UTC-7, Graham wrote:
Dear all, still new to CakePHP but learning all the time.

I have a small PHP utility routine for ​formatting text that I want to be able to call from my views. Where should I save it so that it is available to all views?

Thanks for your thoughts.

Graham

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: