hmm, I changed the member to protected but this still seems to trigger the
warning error.



Matthew Weier O'Phinney-3 wrote:
> 
> -- j5 <> wrote
> (on Wednesday, 10 December 2008, 02:42 PM -0800):
>> For my login form, I pass the form my user model (to be used by
>> validators)
>> and in the forms init() I add the model to a private variable.
>> 
>> I notice when I try display the form I get the following error.
>> Warning: htmlspecialchars() expects parameter 1 to be string, object
>> given
>> in /home/blah/library/Zend/View/Abstract.php
>> 
>> I tracked this problem back to my user model not having a __toString()
>> function. If I add a __toString() function that returns '' within my user
>> model this error goes away.
> 
> Make the property storing the model protected. Public members are passed
> as attributes to the view helper -- which is why you are getting this
> message.
> 
>> Does anyone have any ideas how to avoid this problem without having to
>> create the __toString() soley for this purpose?
> 
> -- 
> Matthew Weier O'Phinney
> Software Architect       | [EMAIL PROTECTED]
> Zend Framework           | http://framework.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Attaching-a-model-within-a-Zend_Form-instance-causes-an-error-on-display-tp20945740p20947765.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to