Exemple #1
0
 public function __construct(\Doctrine\ORM\EntityManager $em = null)
 {
     // we want to ignore the name passed
     parent::__construct('frmuser');
     $this->em = $em;
     $this->setAttribute('method', 'post')->setHydrator(new ClassMethodsHydrator(false))->setInputFilter(new InputFilter());
     $fieldset = new Fieldset\FsUser($em);
     $fieldset->setUseAsBaseFieldset(true);
     $this->add($fieldset);
     $stafffieldset = new Fieldset\FsStaff($em);
     $stafffieldset->setUseAsBaseFieldset(false);
     $this->add($stafffieldset);
     $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'password', 'options' => array('label' => 'Password:*'), 'attributes' => array('required' => 'required', 'class' => 'form-control')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'cpassword', 'options' => array('label' => 'Confirm password:*'), 'attributes' => array('required' => 'required', 'class' => 'form-control')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Checkbox', 'name' => 'ishead', 'options' => array('label' => 'Head of department:', 'checked_value' => '1', 'unchecked_value' => '0')));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Login', 'class' => 'btn btn-lg btn-primary btn-block')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'fkRoleid', 'options' => array('label' => 'Role:*', 'value_options' => $this->getRoles(), 'empty_option' => '--Select--'), 'attributes' => array('required' => 'required', 'class' => 'form-control')));
 }
Exemple #2
0
 public function __construct(\Doctrine\ORM\EntityManager $em = null)
 {
     // we want to ignore the name passed
     parent::__construct('frmstaff');
     $this->em = $em;
     $this->setAttribute('method', 'post')->setHydrator(new ClassMethodsHydrator(false))->setInputFilter(new InputFilter());
     $fieldset = new Fieldset\FsStaff($em);
     $fieldset->setUseAsBaseFieldset(true);
     $this->add($fieldset);
     //        $this->add(array(
     //            'name' => 'submit',
     //            'attributes' => array(
     //                'type' => 'submit',
     //                'value' => 'Login',
     //                'class' => 'btn btn-lg btn-primary btn-block'
     //            )
     //        ));
 }