html - How to customize error output in Zend_Form for table layout -
I need the following form layout for output: This element and label is required to be centered vertically and the errors must be with the same indentation as the element. Can I get it with the use of this decorator or may I need to change my markup?
After the
You will use the decorator. For the most straightforward example of a custom decorator, especially check out the My_Decorator_SimpleInput Decorator.
So you can do something with rows of
My_Decorator_SimpleInput Zend_Form_Decorator_Abstract {protected $ _format = '& lt; TR & gt; & Lt; TD & gt; & Lt; Label for = "% s" & gt;% s & lt; / Labels & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Input id = "% s" name = "% s" type = "text" value = "% s" /> & Lt; / TD & gt; & Lt; / TR & gt; '; Public Function Render ($ content) {$ element = $ this- & gt; GetElement (); $ Name = htmlentities ($ element-> getFullyQualifiedName ()); $ Label = HTMLentities ($ element-> getLabel ()); $ Id = HTMLentities ($ element-> getId ()); $ Value = htmlentities ($ element- & gt; getValue ()); $ Markup = sprintf ($ this-> _format, $ id, $ label, $ id, $ names, $ value); Return markup; }}
Comments
Post a Comment