Thursday, April 28, 2011

Problem with Variables in Elements

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.

--
Santiago Basulto.-

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: