View class also have method "set" that works like "set" in controller
- make variable avaliable in whole "rendering session" - layout, view,
elements.
If you need to make avaliable some generic data, you should use set.
If you just need to make some data avaliable to some element, you
should pass it with second parameter of $this->element() method.

On Feb 7, 6:02 pm, WebbedIT <[email protected]> wrote:
> Should you be using $this->set in a view?  Set is used in the
> controller to pass a variable to the view then you pass on those
> variables to the element within the element call ...
>
> $this->element('view', array('var1' => $var1, 'var2' => $var2));
>
> My previous query still remains unanswered though as any variables you
> place in the $this->data array are automatically available in all
> views and elements, but is it ok/proper to pass variables in this way?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to