variable is accessed from $variableName.
Something sounds wrong with your methodology If you're setting
variables in an element to be used in other elements/parts of the
layout. An element by definition is a contained collection of view
code, not sure why it should interact during a page load with other
elements.
HTH, Paul
@phpMagpie
On Sep 1, 6:20 pm, Xoubaman <xouba...@gmail.com> wrote:
> I have an element in layout that generates some variables I want to use
> following parts of layout and view. As read in doc
> (http://book.cakephp.org/view/1086/set), using $this->set('varname', $value)
> will result in $varname available in the layout, but I'm getting a Undefined
> variable notice.
>
> debug($this->viewVars) before the var-generating element throws something
> like:
>
> Array
> (
> [title_for_layout] => Awesome web
> [controller_set_var1] => lol
> [controller_set_var2] => foo
> )
>
> Then, the element is echoed, and debugging $this->viewVars shows:
>
> Array
> (
> [title_for_layout] => Awesome web
> [controller_set_var1] => lol
> [controller_set_var1] => lol
> [element_set_var] => gotcha!
> )
> But $element_set_var stills undefined.
>
> Is this the normal behavior? Should I take $element_set_var manually from $this->viewVars?
--
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:
Post a Comment