Hello,

> I find myself repeating myself with some simple code snippets i have
> functions for simple tasks that i tend to repeat often (like finding a
> unique filename from a directory and grabbing a files extension etc
> etc), I put these functions inside components that i have written as
> well as controllers, i realise i could write a general component for
> these functions and have components include that component in the
> component array (phew) same with controllers, however this seems a bit
> long winded.  I was wondering if cakephp allows for similar
> functionality to the ZendFramework where you can drop in libraries and
> then just call the function directly?  This would be very useful for
> this general set of 'utilities' which dont really fall under the
> component category imo.
>
> actually one thing just did occur to me - i could perhaps include this
> 'utilities' component at the app_controller level?

If you only need these functions at the C tier, you could make a
utility controller. If you need some of these functions at all 3 tiers
(M, V, C), you can create custom library and include it using
App::import() in app/config/bootstrap.php.

Regards,
Piotr

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to