Advertisement
Guest User

Untitled

a guest
Dec 14th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2. class Form_DetailsForm extends Zend_Form
  3. {
  4.     public function init()
  5.     {
  6.     // ...
  7.         $phone = new Zend_Form_Element_Text('phone');
  8.         $phoneLabelExtra = $translate->_('deal511-extra');
  9.         $labelText = sprintf("%s \n<br /><span class=\"label-description\">%s</span>",
  10.             htmlspecialchars($translate->_('deal511')), htmlspecialchars($phoneLabelExtra)
  11.         );
  12.         Zend_Registry::get('fb')->info($labelText);
  13.         $phone->setLabel($labelText)
  14.             ->addFilters(array(
  15.                 'StringTrim',
  16.                 'HtmlEntities'
  17.             ))
  18.             ->addValidator('NotEmpty', true)
  19.             ->setRequired(true)
  20.             ->setOptions(array('class' => 'field-phone'));
  21.         $labelDecorator = $phone->getDecorator('Label');
  22.         $labelDecorator->setOption('escape', false);
  23.         $this->addElement($phone);
  24.     // ...
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement