Neriodavid(Wei Dai) wrote:
> 
>    If a class has a protected member/property, say _data, which be
> assigned
> to as a Zend' Db row object on the member table, can you access it as:
> 
>   after $this->_data = $member;
>   $this->emailAddress, instead of $this->_data->emailAddress ?
> 

It doesn't work that way automatically.  You have to implement a __get()
method in the current class, something like this:

public function __get($key)
{
  return $this->_data->$key;
}


Neriodavid(Wei Dai) wrote:
> 
> And, also, in the register view, when we assigned the view variable
> emailAddress etc, so use the echo $this->escape($this->emailAddress) do
> not
> generate an undefined variable warning?
> 

It looks like Zend_View_Abstract has a method strictVars().  By default,
Zend_View will return null if you specify a variable that hasn't been
defined.  If you call $view->strictVars(true), then subsequent references to
undefined variables raise an E_USER_NOTICE error.

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/some-simple-questions-tp18448329p18449186.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to