Hi All,

Let's look at it this way:

1) If a line of code like $this->set('Foo',$bar); is executed by any
controller, a variable named $Foo will be available in the view/layout
with the contents $bar.

2) If you define a method in your app_controller and in one of your
controllers you override the method, you can run the parent code by
calling parent::methodName();

Therefore, for example, if you create in app_controller:
function beforeRender() {
 $this->set('Foo',$bar);
}

and in any child controller than needs to use this method you code it
as:
function beforeRender() {
 ... specific logic...
 parent::beforeRender();
}

Then the variable $foo will always be present in your view/layout.

HTH,

AD7six
PS. Tested/Used


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to