コード例 #1
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'int', array('label' => 'Int:', 'required' => true));
     $this->addElement('text', 'string', array('label' => 'String:', 'required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Create'));
 }
コード例 #2
0
 public function init()
 {
     parent::init();
     $role_mapper = new Application_Model_RoleMapper();
     $roles = $role_mapper->fetchAll();
     $resource_mapper = new Application_Model_ResourceMapper();
     $resources = $resource_mapper->fetchAll();
     $privilege_mapper = new Application_Model_PrivilegeMapper();
     $privileges = $privilege_mapper->fetchAll();
     $multi_options = array('' => 'Select option');
     if ($roles) {
         foreach ($roles as $row) {
             $multi_options[$row->getId()] = $row->getRole();
         }
     }
     $this->addElement('select', 'role_id', array('required' => true, 'label' => 'Role:', 'MultiOptions' => $multi_options));
     $multi_options = array('' => 'Select option');
     if ($resources) {
         foreach ($resources as $row) {
             $multi_options[$row->getId()] = $row->getResource();
         }
     }
     $this->addElement('select', 'resource_id', array('label' => 'Resource:', 'MultiOptions' => $multi_options));
     $multi_options = array('' => 'Select option');
     if ($privileges) {
         foreach ($privileges as $row) {
             $multi_options[$row->getId()] = $row->getPrivilege();
         }
     }
     $this->addElement('select', 'privilege_id', array('label' => 'Privilege:', 'MultiOptions' => $multi_options));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Add Role-Resource-Privilege'));
 }
コード例 #3
0
 public function init()
 {
     parent::init();
     $this->addElement('hidden', 'id', array('required' => true));
     $this->addElement('text', 'privilege', array('label' => 'Privilege:', 'required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Update Privilege'));
 }
コード例 #4
0
ファイル: FaqCreate.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     $this->addElement('text', 'question', array('label' => 'Question:', 'required' => true));
     $this->addElement('text', 'answer', array('label' => 'Answer:', 'required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Create'));
 }
コード例 #5
0
ファイル: FaqFind.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     $multi_options = array('' => 'Select option', 'id' => 'ID: ', 'question' => 'Question: ', 'answer' => 'Answer: ');
     $this->addElement('select', 'where', array('label' => 'Condition:', 'MultiOptions' => $multi_options));
     $this->addElement('text', 'value', array('label' => 'Value:', 'required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Search'));
 }
コード例 #6
0
 public function init()
 {
     parent::init();
     $this->addElement('password', 'password', array('label' => 'Password:'******'required' => true));
     $this->addElement('password', 'password_confirm', array('label' => 'Confirm Password:'******'required' => true));
     $this->addElement('hidden', 'password_reset_key');
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Reset Password'));
 }
コード例 #7
0
 public function init()
 {
     parent::init();
     $multi_options = array('' => 'Select option', 'id' => 'ID: ', 'role_id' => 'Role ID: ', 'resource_id' => 'Resource ID: ', 'privilege_id' => 'Privilege ID: ');
     $this->addElement('select', 'where', array('label' => 'Condition:', 'MultiOptions' => $multi_options));
     $this->addElement('text', 'value', array('label' => 'Value:', 'required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Search'));
 }
コード例 #8
0
ファイル: ExampleEdit.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     // Add this hidden ID field
     $this->addElement('hidden', 'id', array('required' => true));
     $this->addElement('text', 'int', array('label' => 'Int:', 'required' => true));
     $this->addElement('text', 'string', array('label' => 'String:', 'required' => true));
     // Change the label to Update
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Update'));
 }
コード例 #9
0
ファイル: UserEdit.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     $this->addElement('text', 'first_name', array('label' => 'First name:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'last_name', array('label' => 'Last name:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'first_name', array('label' => 'First name:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'phone', array('label' => 'Phone:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'email', array('label' => 'Email:', 'required' => true, 'filters' => array('stringTrim'), 'validators' => array('EmailAddress')));
     $this->addElement('text', 'address', array('label' => 'Address:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'city', array('label' => 'City:', 'required' => true, 'filters' => array('StringTrim')));
     $this->addElement('text', 'state', array('label' => 'State:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(2, 2)))));
     $this->addElement('text', 'zip', array('label' => 'Zip:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array('PostCode')));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Update'));
 }
コード例 #10
0
 public function init()
 {
     parent::init();
     $controller_mapper = new Application_Model_ControllerMapper();
     $controllers = $controller_mapper->fetchAll();
     $multi_options = array('' => 'Select option');
     if ($controllers) {
         foreach ($controllers as $row) {
             $controller = $row->getController();
             $multi_options[$controller] = $controller;
         }
     }
     $this->addElement('select', 'resource', array('label' => 'Resource:', 'required' => true, 'MultiOptions' => $multi_options));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Add Resource'));
 }
コード例 #11
0
ファイル: RoleCreate.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     $role_mapper = new Application_Model_RoleMapper();
     $roles = $role_mapper->fetchAll();
     $this->addElement('text', 'role', array('label' => 'Role:', 'required' => true));
     $multi_options = array('' => 'Select option');
     if ($roles) {
         foreach ($roles as $row) {
             $multi_options[$row->getId()] = $row->getRole();
         }
     }
     $this->addElement('select', 'inherited_role_id', array('label' => 'Role to Inherit From:', 'MultiOptions' => $multi_options));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Add Role'));
 }
コード例 #12
0
ファイル: Delete.php プロジェクト: alclin/zend_framework
 public function init()
 {
     parent::init();
     $this->addElement('hidden', 'id', array('required' => true));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Delete'));
 }
コード例 #13
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'email', array('label' => 'Email:', 'required' => true, 'filters' => array('stringTrim'), 'validators' => array('EmailAddress')));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Submit'));
 }