Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 14th, 2012  |  syntax: PHP  |  size: 0.88 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data