I'm putting together a component to move a bunch of logic out of one
of my controllers. The component has a method whose sole purpose is to
set a number of vars for a view that's tightly-coupled to the
component. I wanted to do it this way because there are several places
where these are required to be set, though the values come from
different places. This way, I can pass the values t the component and
have it set everything the way it requires.
Anyway, my component method looks something like:
public function setStuff($foo, $bar, $something_else)
{
$this->controller->set(compact('foo', 'bar', 'something_else'));
}
The component also has this startup method:
function startup(&$controller)
{
$this->controller = $controller;
}
(and, of course, a $controller member var)
Unfortunately, this doesn't appear to be working--I'm getting
undefined vars in the view. Is there any reason why I couldn't set
view vars from the component like this? I know the vars are available
in the symbol table, of course, though I did put a debug(compact(...))
in there, just to be sure.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---