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
ZF1 decorators are a known source of confusion. If you put a little bit of effort though and get to know how they build up a resulting HTML it's quite simple to achieve what you want.
I suppose you haven't overridden ZF's default decorators for form element. Then they are (remember they're executed in order, altering what was returned by previous decorator):
Now what you need is adding
<span> some text </span>
after input (or errors/description), but before it's wrapped bydd
. It means new decorator should be added to a chain of existing decorators in a correct position.