History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-3052
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Matthew Weier O'Phinney
Reporter: Julian Davchev
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

leacking unnecessary attributes into html source. viewScript + helper

Created: 05/Apr/08 07:11 AM   Updated: 03/Sep/08 12:00 AM
Component/s: Zend_Form
Affects Version/s: None
Fix Version/s: Next Minor Release

Time Tracking:
Not Specified

Fix Version Priority: Nice to Have


 Description  « Hide
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:
<select name="el_name" id="el_name" helper="formSelect" viewScript="index/ba.html">



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Julian Davchev - 05/Apr/08 07:11 AM
Setting to Zend_Form componnent...forgot to mention

Matthew Weier O'Phinney - 09/May/08 11:23 AM
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.


Matthew Weier O'Phinney - 09/May/08 11:27 AM
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.

Julian Davchev - 11/Aug/08 12:08 PM
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.