Example #1
0
 public function init()
 {
     $this->setMethod('POST');
     $element = new Element\Text('title');
     $element->setLabel('Title:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Select('name');
     $element->setLabel('Directory:');
     $element->setRequired(true);
     $element->addMultiOptions($this->model->getThemesDirectoriesFromFS());
     $this->addElement($element);
     $element = new Element\Radio('active');
     $element->setSeparator(' ');
     $element->setLabel('Active:');
     $element->setValue(false);
     $element->setMultiOptions(array('1' => 'Yes', '0' => 'No'));
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('ordering');
     $element->setLabel('Ordering:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Submit('submit');
     $element->setLabel('Save');
     $element->setIgnore(true);
     $this->addElement($element);
 }
Example #2
0
 /**
  * Builds time fieldset and returns it.
  * 
  * @return Fieldset
  */
 public function getTimeFieldset()
 {
     $timeFieldset = new Fieldset('time');
     // Picker field
     $picker = new Element\Radio('picker');
     $picker->setLabel('Pick Time');
     $picker->setValueOptions($this->_timeOptions);
     $picker->setValue(self::SPECIFIC_TIME);
     $timeFieldset->add($picker);
     // Attach "child" fieldsets
     $timeFieldset->add($this->getSpecificTimeFieldset());
     $timeFieldset->add($this->getEveryHourFieldset());
     $timeFieldset->add($this->getEveryMinuteFieldset());
     return $timeFieldset;
 }
 /**
  * {@inheritDoc}
  */
 public function setValue($value)
 {
     return parent::setValue($this->getProxy()->getValue($value));
 }