Hi,
if the idea is to use your own lib or "global component" and make it
globally available (cpntroller, component, helper, ...), I would see
a solutions similar to the vendor approach. As you stated vendor could
be considered for third party libs.
One approach would be to create your own lib directory, e.g. /app/
mylib and put your globally accessible classes or utilities there.
You could then have a function like this:
<code>
function uses_mylib() {
$args = func_get_args();
foreach ($args as $arg) {
if (file_exists(APP . 'mylib' . DS . $arg . '.php')) {
require_once(APP . mylib' . DS . $arg . '.php');
} else {
}
}
}
</code>
and place it in a file called app/mybasics.php for instance and
require this in your app_controller, like so
<code>
require_once (APP . DS . 'mybasics.php');
</code>
above the class definition, which will make sure it is always
available.
Then, from anywhere inside your application, you can just write:
<code>
uses_mylib('Translator', 'GlobalUtils');
</code>
And the functionality is at your service similar to the uses function
of cake.
Cheers,
jp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---