Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 27th, 2012  |  syntax: None  |  size: 1.28 KB  |  hits: 13  |  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. Wraping Labels in Zend_Form_Element_Radio
  2. public $radioDecorators = array(
  3.     'ViewHelper',
  4.     array('Description',array('tag'=>'div','class'=>'','placement' => 'prepend')),
  5.     array('Errors',array('class'=>'error_message_show','placement' => 'prepend')),
  6.     array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element')),
  7.     array('label', array('class'=>'label_text','placement' => 'prepend')),
  8.     array(array('rows' => 'HtmlTag'), array('tag' => 'div', 'class' => 'radio')),
  9. );
  10.  
  11.  
  12.     $offer_type = new Zend_Form_Element_Radio('offer_type', array(
  13.                 'label' => 'Label I'd like to wrap with inputs',    //Label to wrap
  14.                 'required' => true,
  15.                 'description' => '',
  16.                 'decorators' => $this->radioDecorators,
  17.                 'multioptions' => array (
  18.                     'standard' => 'standard',
  19.                     'premium' => 'premium',
  20.                 ),
  21.             ));
  22.     $this->addElement($offer_type);
  23.        
  24. $offer_type = new Zend_Form_Element_Radio('offer_type', array(
  25.     'separator' => '</li><li>',
  26.     'decorators' => array(
  27.         'ViewHelper',
  28.         array(array('liWrapper' => 'HtmlTag'), array('tag' => 'li')),
  29.         array(array('ulWrapper' => 'HtmlTag'), array('tag' => 'ul')),
  30.         // the rest
  31.     )
  32. ));