Try $this->clientName
On Apr 1, 1:42 pm, Kyle Decot <[EMAIL PROTECTED]> wrote:
> I tried tried putting them in the app_controller like:
>
> <?php
>
> class AppController extends Controller {
>
> var $clientName = "Somebody";
>
> //etc
>
> }
>
> but then when I try to access it in my PagesController i get an
> undefined variable.
>
> <?php
> class PagesController extends AppController{
>
> var $name = 'Pages';
> var $uses = "Pages";
>
> var $components = array("Email");
>
> function about() {
>
> $this->set("title",$clientName);
> // etc
>
> Any other suggestions?
>
> On Apr 1, 3:55 pm, Zoltan <[EMAIL PROTECTED]> wrote:
>
> > if they're constants, put them in the bootstrap file,e.g.
>
> > // sales taxes
> > Configure::write('gst', 0.05);
>
> > if they are dynamic, maybe override app_controller.php (copy
> > app_controller.php from cake folder into app/) and set variables
> > there, that should work too.
>
> > Zoltanwww.yyztech.ca
>
> > On Apr 1, 2:55 pm, Kyle Decot <[EMAIL PROTECTED]> wrote:
>
> > > I make a lot of similar websites for work and I would like to be able
> > > to make a custom settings file where I can store variables that will
> > > be used throughout the site. For example I want to have:
>
> > > <?
>
> > > $clientName = "Joe Somebody";
> > > $clientPhone = "111-111-1111";
>
> > > //etc
>
> > > ?>
>
> > > I would then like to be able to use those variables in all my
> > > controllers and actions. How would I do this ? Thanks for the help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---