ZF-10519: Zend_Form_Decorator_File decorator is using static view helper
Description
Zend_Form_Decorator_File, Line 126 and 129
The view helper "$view->formFile()" is typed and not used dynamic from the elements helper ($element->helper). So it's not possible to override / extend the formFile view helper.
(Using 1.11.0dev, source from http://framework.zend.com/svn/framework/…)
{{+Line 126:+ $markup[] = $view->formFile($name, $htmlAttribs);}}
{{+Line 129:+ $markup[] = $view->formFile($name, $attribs);}}
Comments
Posted by Ing. Alexander Poschenreithner (klex) on 2010-10-06T00:34:49.000+0000
I made a patch but didn't find a way to upload it here.
Index: library/Zend/Form/Decorator/File.php
library/Zend/Form/Decorator/File.php (revision 23012)
{{+ Line 120: $helper = $element->helper;}}
{{- Line 126: $markup[] = $view->formFile($name, $htmlAttribs);}} {{+ Line 126: $markup[] = $view->$helper($name, $htmlAttribs);}}
{{- Line 129: $markup[] = $view->formFile($name, $attribs);}} {{+ Line 129: $markup[] = $view->$helper($name, $attribs);}}
============================================ END
Best regards, Alex
Posted by Adam Lundrigan (adamlundrigan) on 2010-12-18T13:45:07.000+0000
Thank you for your suggestion. I've added a patch containing your suggested fix and a test case for it.
Posted by Rob Allen (rob) on 2012-11-03T14:20:47.000+0000
Patch applied to trunk (25066) and release-1.12 (25067)