<?php
class Form_DetailsForm extends Zend_Form
{
public function init()
{
// ...
$phone = new Zend_Form_Element_Text('phone');
$phoneLabelExtra = $translate->_('deal511-extra');
$labelText = sprintf("%s \n<br /><span class=\"label-description\">%s</span>",
htmlspecialchars($translate->_('deal511')), htmlspecialchars($phoneLabelExtra)
);
Zend_Registry::get('fb')->info($labelText);
$phone->setLabel($labelText)
->addFilters(array(
'StringTrim',
'HtmlEntities'
))
->addValidator('NotEmpty', true)
->setRequired(true)
->setOptions(array('class' => 'field-phone'));
$labelDecorator = $phone->getDecorator('Label');
$labelDecorator->setOption('escape', false);
$this->addElement($phone);
// ...
}
}