-- j5 <[EMAIL PROTECTED]> wrote (on Wednesday, 10 December 2008, 05:22 PM -0800): > hmm, I changed the member to protected but this still seems to trigger the > warning error.
Code? I've done this before without issues, so I'll need some code that reproduces it to diagnose. > 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/
