UPD: solved - added extra decorator.
I need to have the following result:
<dd id="daily_722-element">
<input id="daily_722" type="checkbox" name="daily_722" value="1">
<span> some text </span>
</dd>
I need to have "some text" wrapped by html tags just after checkbox, BUT before /DD (NOT after)!
My current code is as follows:
$chk = new Zend_Form_Element_Checkbox('daily_shit');
$chk->setLabel('<span class="dt-note">'. $firstName. '</span>');
$chk->getDecorator('label')->setOption('escape', false);
So it produces:
<dd id="daily_722-element">
<input id="daily_722" type="checkbox" name="daily_722" value="1">
</dd>
And I cannot get a clue how to inject extra HTML after checkbox... but inside DD
You can write custom decorator for this. Method
renderreceives original content and changes it, than returns changed content.And use it in form building