Esempio n. 1
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('safactions');
     $id = new Zend_Form_Element_Hidden('id');
     $hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $label = new Zend_Form_Element_Text('label');
     $label->setLabel('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('description');
     $safcontrollersId = new Zend_Form_Element_Select('safcontrollers_id');
     $options = new Safcontrollers();
     $safcontrollersId->addMultiOption('', '----------');
     foreach ($options->fetchAlltoFlatArray() as $k => $v) {
         $safcontrollersId->addMultiOption($k, $v['mlabel']);
     }
     $safcontrollersId->setLabel('safcontrollers_id');
     $this->addElements(array($id, $hash, $label, $name, $description, $safcontrollersId));
     $this->addElements(array($submit));
 }
 public function init()
 {
     $options = new Safcontrollers();
     foreach ($options->fetchAlltoFlatArray() as $k => $v) {
         if (isset($v['mlabel'])) {
             $this->addMultiOption($k, $v['mlabel']);
         }
     }
 }