Friday, January 25, 2013

Components vs Helpers vs Utilities

Im trying to wrap my head around utilzing some functionality at all levels of MVC. Right now, I'm writing a component that performs several date functions for my app (the date utility is insufficient for what Im doing). The problem is I need the these functions in both my models and views as well. I'd imagine writing my own Utility is the best option as it can be used anywhere but they seem "off limits" as they are only contained within the Lib. I also cant find any information on writing a Utility. Yes, I could just go write one and add it to Lib/Utilities but I'm looking for some feedback on this issue as I've faced it several times. If you need to share functionality between all layers of the MVC, is using utilities the only way to do it without having to load a component/helper/behavior on the fly?
Thanks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: