ZF-11577: htmlspecialchars() expects parameter 1 to be string, array given
Description
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /usr/share/php/libzend-framework-php/Zend/View/Abstract.php on line 897.
this is code from form, $this->setDecorators(array( 'FormElements', array('Errors', array('placement' => 'PREPEND')), array('HtmlTag', array('tag' => 'dl', 'class' => 'login_elements')), 'Form' ));
everything is ok until array('Errors', array('placement' => 'PREPEND')) is put into setDecorators or just 'Errors' ...
Comments
Posted by Kai Uwe (kaiuwe) on 2011-07-19T10:20:33.000+0000
There's a difference if the errors messages comes from an element or from the form.
At the moment it is a bad idea to use the "Errors" decorator for the whole form, because there is no reference to the element or to the label of the element.
We need a solution which respects the array from the form and which outputs the label from the element.
Foo: Value is required and can't be emptyPosted by Matthew Weier O'Phinney (matthew) on 2011-07-19T13:35:20.000+0000
There is already a special decorator (and view helper) for displaying errors at the form level, "FormErrors"; use that instead of the "Errors" decorator.
Posted by Kai Uwe (kaiuwe) on 2011-07-19T14:12:22.000+0000
Matthew is right. Damn, I use it even in my own scripts!
Thanks to Matthew.