Monday, February 2, 2009

Re: Where to define constants

I recommend using some other file and then loading that file in the
bootstrap.

This way if you need to update cake files you don't have to worry
about overriding your stuff, well, only one line will be lost.

I use a appconfig.php file with my stuff and then I load it in the
bootstrap like this

Configure::load('appconfig');

On Feb 2, 12:23 pm, Turgs <timb....@gmail.com> wrote:
> Thanks Brian!!
> I knew they would be a logical place somewhere.
> Cheers
> Turgs
>
> On Feb 2, 4:38 am, brian <bally.z...@gmail.com> wrote:
>
> > Place them in config/bootstrap.php.
>
> > But, if you're doing language-specific stuff, you'd be *far* off
> > creating .po files and putting them in the locale dir.
>
> > On Sun, Feb 1, 2009 at 8:09 AM, Turgs <timb....@gmail.com> wrote:
>
> > > Hi everyone.
>
> > > If I want to use constants within my model code and have those the
> > > constants defined within a separate file (i.e. /
> > > english_constants.php), where can I call require_once('constants.php)
> > > so that my "whole" application (models, views and controllers) can see
> > > those constants?
>
> > > If I put it in the AppController::beforeFilter(), the constants don't
> > > seem to be available within the model.
>
> > > Thanks
> > > Turgs
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: