what Edit : For example, if the HTML generated by Zend_Form for a I have to output it to: Using the decorator to insert the HTML you want in your elements For example: For example, I can: It should have the following html code: Hope it is helical Or at least you will tell in the right direction. & lt; Input & gt; Is there a way to add "$" before to the Zend_Form element? (Using standard ZF accessories would be great, of course).
cost element is something like this: (very simple)
& lt; Label & gt; Price: & lt; / Label & gt; & Lt; Input type = "text" name = "cost" />
$ el1 = $ this- & gt; Create Element ('Text', 'L1') - & gt; SetLabel ('cost:'); // Anonymous function that will generate your custom HTML (requires PHP 5.3) // There are other ways to create anonymous functions for old PHP. $ MyHtml = function ($ content, $ element, array $ option) {return '$'; }; $ El1- & gt; Set decorators ('arrows', 'view halber', 'errors', arrays ('callback', array ('callback' = & gt; $ myHtml, 'placement' => gt; 'PREPEND')), 'labels' / Code>
label = "el1" class = "optional" & gt; value: & lt; / label & Gt; $ & lt; input type = "text" name = "L1" id = "L1" value = "" />
Comments
Post a Comment