On Thu, Apr 28, 2011 at 10:10 AM, Santiago Basulto <[email protected]> wrote: > Hello People, > > i'm using CakePHP 1.3.5. > > When i pass a variable to an element, as the book says > (http://book.cakephp.org/view/1081/Elements) i can't use it, i get > this error message: Notice (8): Undefined variable: variable > [APP/views/elements/header.ctp, line 2] > > Here's my code: > In the layout: > <?php echo $this->element('header',array('variable'=>'value')); ?> > In the element (here's where te error arises): > <?php debug($variable); ?>Notice (8): Undefined variable: > variable [APP/views/elements/header.ctp, line 2] > > What's going on? I've disabled all cache but still doesn't work.
Looks ok to me. Are you sure the spelling is good? Does the call to this element occur in any other layouts? Maybe you're in a different layout, which doesn't also have the variable assignment. Long shot, I know. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
