Bert,
Logical reason is it is not awkward but correct to use the view var that was set in the controller, they are not even variables until the view "gets" them. If you need to check that your code set them, then the logical place to check is in the var itself, or like I said, since they are output variables check that the variables have been set for the view in the view.
Another suggestion create __checkVars($viewVariable); in your controller.
Something like this:
function __checkVar($viewVariable) {
if(in_array($viewVariable, $this->_viewVars)){
// add your code
} else {
// do something else
}
}
And use it to check your variables.
--
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- Re: Simple question about $this->set Vanchuck
- Re: Simple question about $this->set Mark Somerville
- Re: Simple question about $this->s... Felix Geisendörfer
- Re: Simple question about $this->s... nate
- Re: Simple question about $this-&... Larry E. Masters aka PhpNut
- Re: Simple question about $th... nate
- Re: Simple question abou... Bert Van den Brande
- Re: Simple question ... Larry E. Masters aka PhpNut
- Re: Simple question ... nate
- Re: Simple quest... Bert Van den Brande
- Re: Simple quest... John Zimmerman
- Re: Simple quest... Bert Van den Brande