ZF-3052: leacking unnecessary attributes into html source. viewScript + helper
Description
viewScript and helper are set as attributes to elements when source is rendered...
I see sample solution -> Zend_Form_Decorator_Image::$_attribBlacklist
But only there it is implemented.
Should be done for all Elements.
$el = new Zend_Form_Element_Select('el_name');
$el->viewScript = 'index/ba.html';
$el->setDecorators(array(
array('ViewScript', array('class' => 'form element')),
//array('ViewHelper', array('helper' => 'formSelect'))
));
$form->addElement($el);
output:
Comments
Posted by Julian Davchev (jmut) on 2008-04-05T07:11:53.000+0000
Setting to Zend_Form componnent...forgot to mention
Posted by Matthew Weier O'Phinney (matthew) on 2008-05-09T11:23:54.000+0000
While I can see this as nice when validating against w3c, there are applications where having arbitrary attributes can be useful -- dojo and other JS toolkits utilize custom attributes to configure elements.
Any solution such as this (whitelisting or blacklisting) should be configurable -- i.e., it can be either on or off by default, with methods or configuration options to toggle the behavior.
Posted by Matthew Weier O'Phinney (matthew) on 2008-05-09T11:27:10.000+0000
Tentatively scheduling for next minor release. Will require significant amount of work to make form decorators/view helpers comply with w3c specifications, and the benefit, while nice, is one that is negligible.
Posted by Julian Davchev (jmut) on 2008-08-11T12:08:37.000+0000
Well then, perhaps postpone this for later. Maybe not worth so much work if little benefit - never thought of applications needing arbitrary attributes. I just thought of this as bug and from my point of view wasn't so much work. Of course you have much better overview in Zend_Form and the like. I see no votes here so I guess best option is don't touch at all for now.
Posted by Matthew Weier O'Phinney (matthew) on 2009-11-20T12:57:10.000+0000
Too many moving parts. Some parts can be fixed on a case-by-case basis, but a sweeping change to blacklisting would break too many other areas at this time.