If you start adding more functions you may want to put them into a
separate file.
The top of my bootstrap.php looks like this:
// This would mess things up royally--> App::import('Vendor',
'basics');
require_once(APP.'vendors'.DS.'basics.php');
I mention it mostly because you have to do a good old require unless
you want Cake's internals all confused. App::import() can't be used
because of Cake's bootstrapping order. Simply put bootstrap.php is
loaded before the "App" is ready to run. It took me a lot of time and
effort to track down that this was the cause for all sorts of
strangeness.
/Martin
On Aug 11, 4:54 pm, Robert P <[email protected]> wrote:
> The file /app/config/bootstrap.php is there for this exact reason.
>
> On Aug 11, 8:56 pm, alaxos <[email protected]> wrote:
>
>
>
> > Hello,
>
> > I have tried to figure out what would be the best way to add generic
> > functions to an app, in order to then be able to use them everywhere
> > in a Cake application.
>
> > I wrote some time ago (nothing to do with cake) classes with methods
> > that I use to do different things. They are generic classes, that I
> > use for instance to manipulate strings, or whatever.
>
> > I could off course copy/paste them in my components or helper that
> > need them, but I would prefer to have it written at only one place,
> > and be able to call it from everywhere.
>
> > I could also for instance include the files I need somewhere in the
> > app (in 'app_controller.php' maybe).
>
> > But I'd like to know what would be the best way to do it in order to
> > respect the Cake guidelines ?
>
> > Thanks !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---