当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Select::setRequired方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Select::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Select::setRequired方法的具体用法?PHP Zend_Form_Element_Select::setRequired怎么用?PHP Zend_Form_Element_Select::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Select的用法示例。


在下文中一共展示了Zend_Form_Element_Select::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareForm

 /**
  * Prepare form
  * 
  * @param Uni_Core_Form $form 
  */
 protected function _prepareForm(Uni_Core_Form $form)
 {
     $form->setName('menu')->setMethod('post');
     $subForm1 = new Zend_Form_SubForm();
     $subForm1->setLegend('Menu Item Information');
     $subForm1->setDescription('Menu Item Information');
     $idField = new Zend_Form_Element_Hidden('id');
     $title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
     $title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
     $link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
     $open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
     $open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
     $status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
     $status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
     $sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
     $sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $style_class = new Zend_Form_Element_Text('style_class');
     $style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
     $menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
     $menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
     $subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
     $form->addSubForm($subForm1, 'subform1');
     parent::_prepareForm($form);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:30,代码来源:Form.php

示例2: init

 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input'));
     $ho_ten = new Zend_Form_Element_Text('ho_ten');
     $ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 120))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $chuc_vu = new Zend_Form_Element_Text('chuc_vu');
     $chuc_vu->setLabel('Chức vụ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $don_vi = new Default_Model_DonVi();
     $dvOptions = array("multiOptions" => $don_vi->getDSDV());
     $ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions);
     $ma_don_vi->setRequired(true)->setLabel('Đơn vị (*)')->setValue(Default_Model_Constraints::ID_DHSG)->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $hoc_vi = new Default_Model_HocVi();
     $hvOptions = array("multiOptions" => $hoc_vi->getDSHV());
     $ma_hoc_vi = new Zend_Form_Element_Select('ma_hoc_vi', $hvOptions);
     $ma_hoc_vi->setRequired(true)->setLabel('Học vị (*)')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'email'));
     $so_dien_thoai = new Zend_Form_Element_Text('so_dien_thoai');
     $so_dien_thoai->setLabel('Số điện thoại')->addFilter('StringTrim')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'onkeypress' => 'return inputNumber(event)'));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $link = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($id, $ma, $ho_ten, $ma_don_vi, $ma_hoc_vi, $chuc_vu, $email, $so_dien_thoai, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'giang_vien')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:34,代码来源:GiangVien.php

示例3: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emailcontacts');
     $this->setAttrib('action', BASE_URL . 'emailcontacts/add/');
     $id = new Zend_Form_Element_Hidden('id');
     $group_id = new Zend_Form_Element_Select("group_id");
     $group_id->setRegisterInArrayValidator(false);
     $group_id->setRequired(true);
     $group_id->addValidator('NotEmpty', false, array('messages' => 'Please select group.'));
     $business_unit_id = new Zend_Form_Element_Select("business_unit_id");
     $business_unit_id->setRegisterInArrayValidator(false);
     $business_unit_id->setRequired(true);
     $business_unit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.'));
     $business_unit_id->setAttrib('onchange', "bunit_emailcontacts('business_unit_id');");
     //Group Email....
     $grpEmail = new Zend_Form_Element_Text('groupEmail');
     $grpEmail->addFilters(array('StringTrim', 'StripTags'));
     $grpEmail->setRequired(true);
     $grpEmail->addValidator('NotEmpty', false, array('messages' => 'Please enter group email.'));
     $grpEmail->addValidator("regex", true, array('pattern' => '/^(?!.*\\.{2})[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid email.')));
     $grpEmail->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_emailcontacts', 'field' => 'groupEmail', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1')));
     $grpEmail->getValidator('Db_NoRecordExists')->setMessage('Group email already exists.');
     // Form Submit .........
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $group_id, $grpEmail, $submit, $business_unit_id));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:31,代码来源:emailcontacts.php

示例4: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $accountId1 = new Zend_Form_Element_Hidden('accountId');
     $productId1 = new Zend_Form_Element_Hidden('productId');
     $memberId1 = new Zend_Form_Element_Hidden('memberId');
     $maturedamount = new Zend_Form_Element_Hidden('maturedinterestamount');
     $interestamountto = new Zend_Form_Element_Hidden('interestamountto');
     $capitalamount = new Zend_Form_Element_Hidden('capitalamount');
     $penalinterest = new Zend_Form_Element_Hidden('penalinterest');
     $paymenttype = new Zend_Form_Element_Select('paymenttype');
     $paymenttype->addMultiOption('', 'select..');
     $paymenttype->setAttrib('class', 'NormalBtn');
     $paymenttype->setAttrib('id', 'paymenttype');
     $paymenttype->setAttrib('onchange', 'toggleField();');
     $paymenttype->setRequired(true);
     $description = new Zend_Form_Element_Textarea('transactiondescription');
     $description->setAttrib('class', 'textfield');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $no = new Zend_Form_Element_Textarea('paymenttype_details');
     $no->setAttrib('class', 'textfield');
     $no->setAttrib('rows', '1');
     $no->setAttrib('cols', '20');
     $no->setAttrib('id', 'paymenttype_details');
     $no->setAttrib('style', 'display:none;');
     $no->setRequired(true);
     $submit = new Zend_Form_Element_Submit('Finalize');
     $submit->setLabel('Finalize');
     $submit->setAttrib('class', 'recurring');
     $this->addElements(array($accountId1, $productId1, $memberId1, $maturedamount, $submit, $capitalamount, $interestamountto, $penalinterest, $paymenttype, $description, $no));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:32,代码来源:Finalize.php

示例5: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', DOMAIN . 'workeligibilitydoctypes/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'workeligibilitydoctypes');
     $id = new Zend_Form_Element_Hidden('id');
     $documenttype = new Zend_Form_Element_Text('documenttype');
     $documenttype->setAttrib('maxLength', 50);
     $documenttype->setRequired(true);
     $documenttype->addValidator('NotEmpty', false, array('messages' => 'Please enter document type.'));
     $documenttype->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9\\-\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid document type.')));
     $documenttype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_workeligibilitydoctypes', 'field' => 'documenttype', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
     $documenttype->getValidator('Db_NoRecordExists')->setMessage('Document type already exists.');
     $issuingauthority = new Zend_Form_Element_Select('issuingauthority');
     $issuingauthority->setRegisterInArrayValidator(false);
     $issuingauthority->setMultiOptions(array('' => 'Select issuing authority', '1' => 'Country', '2' => 'State', '3' => 'City'));
     $issuingauthority->setRequired(true);
     $issuingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select issuing authority.'));
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $documenttype, $issuingauthority, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:29,代码来源:workeligibilitydoctypes.php

示例6: __construct

 public function __construct()
 {
     $transactionType = new Zend_Form_Element_Select('transactionType');
     $transactionType->setAttrib('class', 'NormalBtn');
     $transactionType->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transactionMode = new Zend_Form_Element_Select('transactionMode');
     $transactionMode->setAttrib('class', 'NormalBtn');
     $transactionMode->setRequired(true);
     //                                 ->addValidators(array(array('NotEmpty')));
     $transactionMode->setAttrib('onchange', 'display(this.value);');
     $transaction_interest_amount = new Zend_Form_Element_Text('transaction_interest_amount');
     $transaction_interest_amount->setAttrib('class', 'NormalBtn');
     $transaction_fine_amount = new Zend_Form_Element_Text('transaction_fine_amount');
     $transaction_fine_amount->setAttrib('class', 'NormalBtn');
     $account_id = new Zend_Form_Element_Text('account_id');
     $account_id->setAttrib('class', 'NormalBtn');
     $transaction_date = new Zend_Form_Element_Text('transaction_date');
     $transaction_date->setAttrib('class', 'NormalBtn');
     $transaction_date->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transaction_date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $transaction_amount = new Zend_Form_Element_Text('transaction_amount');
     $transaction_amount->setAttrib('class', 'NormalBtn');
     $transaction_remarks = new Zend_Form_Element_Textarea('transaction_remarks', array('rows' => 3, 'cols' => 15));
     $transaction_remarks->setAttrib('class', 'NormalBtn');
     $transaction_remarks->setRequired(true)->addValidators(array(array('NotEmpty')));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit');
     $submit->setAttrib('class', 'NormalBtn');
     $submit->setLabel('submit');
     $this->addElements(array($transactionType, $transactionMode, $transaction_interest_amount, $transaction_fine_amount, $account_id, $transaction_date, $transaction_amount, $transaction_remarks, $submit));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:31,代码来源:Altertransaction.php

示例7: __construct

 public function __construct($options = null)
 {
     Zend_Dojo::enableForm($this);
     parent::__construct($options);
     $category_id = new Zend_Form_Element_Select('category_id');
     $category_id->addMultiOption('', 'Select...');
     $category_id->setAttrib('class', 'txt_put')->setLabel('Category  Name');
     $category_id->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $productname = new Zend_Form_Element_Text('productname');
     $productname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productdetails', 'productname'));
     $productname->setAttrib('class', 'txt_put')->setLabel('Product Name');
     $productname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $product_id = new Zend_Form_Element_Hidden('product_id');
     $product_id->setAttrib('class', 'txt_put');
     $productshortname = new Zend_Form_Element_Text('productshortname');
     $productshortname->setAttrib('class', 'txt_put')->setLabel('Product Short Name');
     $productshortname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $product_description = new Zend_Form_Element_Textarea('product_description', array('rows' => 3, 'cols' => 20));
     $product_description->setAttrib('class', '')->setLabel('Productdescription');
     $product_description->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('id', 'save')->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('colspan' => '8 ')), array(array('data' => 'HtmlTag'), array('tag' => 'td ', 'colspan' => '8')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElements(array($category_id, $productname, $productshortname, $product_description, $product_id, $submit));
     $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'table', 'id' => 'hor-minimalist-b')), 'Form'));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:25,代码来源:Product.php

示例8: init

 public function init()
 {
     $this->setName('f3')->setMethod('get');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 70px'));
     $ho = new Zend_Form_Element_Text('ho');
     $ho->setLabel('Họ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 100px'));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 50px', 'id' => 'ten'));
     $don_vi = new Default_Model_DonVi();
     $dv = $don_vi->getDSDV();
     $dv = array('0' => '=============== Tất cả ===============') + $dv;
     $dvOptions = array("multiOptions" => $dv);
     $ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions);
     $ma_don_vi->setRequired(true)->setLabel('Đơn vị')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_don_vi'));
     $submit = new Zend_Form_Element_Button('loc', array('type' => 'submit'));
     $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true);
     $reset = new Zend_Form_Element_Button('reset');
     $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ma, $ho, $ten, $ma_don_vi, $submit, $reset));
     // Element: order
     $this->addElement('Hidden', 'order', array('order' => 10004));
     // Element: direction
     $this->addElement('Hidden', 'direction', array('order' => 10005));
     $this->addDisplayGroup(array('ma', 'ho', 'ten', 'ma_don_vi', 'loc', 'reset'), 'filter', array('order' => '0', 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_gv')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:29,代码来源:FilterGV.php

示例9: init

 public function init()
 {
     $this->setName('f3')->setMethod('get');
     $linh_vuc = new Default_Model_LinhVuc();
     $lv = $linh_vuc->getDSLV();
     $lv = array('0' => '========= Tất cả =========') + $lv;
     $lvOptions = array("multiOptions" => $lv);
     $ma_linh_vuc = new Zend_Form_Element_Select('ma_linh_vuc', $lvOptions);
     $ma_linh_vuc->setRequired(true)->setLabel('Lĩnh vực')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_linh_vuc'));
     $nams = Default_Model_Constraints::nam();
     $nams = array('0' => '== Tất cả ==') + $nams;
     ksort($nams);
     $namOption = array("multiOptions" => $nams);
     $nam = new Zend_Form_Element_Select('nam', $namOption);
     $nam->setLabel('Năm')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'nam'));
     $submit = new Zend_Form_Element_Submit('loc');
     $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'danh-sach-hdd'), null, true);
     $reset = new Zend_Form_Element_Button('reset');
     $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ma_linh_vuc, $nam, $submit, $reset));
     // Element: order
     $this->addElement('Hidden', 'order', array('order' => 10004));
     // Element: direction
     $this->addElement('Hidden', 'direction', array('order' => 10005));
     $this->addDisplayGroup(array('ma_linh_vuc', 'nam', 'loc', 'reset'), 'group1', array('order' => 1, 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_hdd', 'style' => 'width : 65%')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:29,代码来源:FilterHDD.php

示例10: init

 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oTranslation = new Zend_Form_Element_Select("translation");
     $oTranslation->setLabel("Tłumaczenie:");
     $oTranslation->setRequired(TRUE)->setAttrib("class", "valid");
     $oTranslation->addMultiOptions($this->_aAllLang);
     $this->addElement($oTranslation);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Dalej");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/lang.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
开发者ID:lstaszak,项目名称:zf_zk_aleph,代码行数:29,代码来源:Lang.php

示例11: init

 public function init($stateId)
 {
     global $mySession;
     $db = new Db();
     $CountryId = "";
     $StateName = "";
     if ($stateId != "") {
         $PageData = $db->runQuery("select * from " . STATE . " where state_id='" . $stateId . "'");
         $CountryId = $PageData[0]['country_id'];
         $StateName = $PageData[0]['state_name'];
     }
     $CounyryArr = array();
     $CounyryArr[0]['key'] = "";
     $CounyryArr[0]['value'] = "- - Country - -";
     $CounyryData = $db->runQuery("select * from " . COUNTRIES . " order by country_name");
     if ($CounyryData != "" and count($CounyryData) > 0) {
         $i = 1;
         foreach ($CounyryData as $key => $CounyryValues) {
             $CounyryArr[$i]['key'] = $CounyryValues['country_id'];
             $CounyryArr[$i]['value'] = $CounyryValues['country_name'];
             $i++;
         }
     }
     $country_id = new Zend_Form_Element_Select('country_id');
     $country_id->setRequired(true)->addMultiOptions($CounyryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setValue($CountryId);
     $state_name = new Zend_Form_Element_Text('state_name');
     $state_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'State Name is required.'))->addValidator('regex', true, array('pattern' => '/^[a-zA-Z\\-]+$/', 'messages' => array('regexNotMatch' => 'Please enter proper name and without space')))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($StateName);
     $this->addElements(array($country_id, $state_name));
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:29,代码来源:State.php

示例12: init

 public function init()
 {
     $this->setMethod('post')->setAttrib('id', 'frmVenta')->setAttrib('style', 'width: 300px;margin:auto;');
     // Producto
     $e = new Zend_Form_Element_Select('id_producto');
     $e->setLabel('Producto');
     $e->setRequired();
     $_producto = new Application_Model_Producto();
     $e->addMultiOption(-1, '--Producto--');
     $e->addMultiOptions($_producto->getComboValues());
     $e->addValidator(new Zend_Validate_InArray($_producto->getComboValidValues()));
     $this->addElement($e);
     // Cantidad
     $e = new Zend_Form_Element_Text('cantidad');
     $e->setLabel('Cantidad');
     $e->setRequired();
     $e->addValidator(new Zend_Validate_Int(new Zend_Locale('US')));
     $e->addValidator(new Zend_Validate_GreaterThan(0));
     $e->addValidator(new Zend_Validate_LessThan(100));
     $this->addElement($e);
     // AddVentaDetalles
     $e = new Zend_Form_Element_Hidden('is_detalle');
     $e->setValue(true);
     $e->setRequired();
     $this->addElement($e);
     //Submit
     $e = new Zend_Form_Element_Submit('submit');
     $e->setLabel('Agregar');
     $this->addElement($e);
 }
开发者ID:helmutpacheco,项目名称:ventas,代码行数:30,代码来源:VentaDetalle.php

示例13: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     parent::__construct();
     $accountCode = new Zend_Form_Element_Hidden('accountcode');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $newStatus = new Zend_Form_Element_Select('newStatus');
     $newStatus->setAttrib('class', 'NormalBtn');
     $newStatus->setRequired(true);
     $newStatus->addMultiOption('', 'Select...');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', '2');
     $description->setAttrib('cols', '20');
     $description->setRequired(true);
     $totalamount = new Zend_Form_Element_Text('totalamount');
     $totalamount->setAttrib('class', 'textfield');
     $totalamount->setAttrib('id', 'totalamount');
     $totalamount->setAttrib('readonly', 'true');
     $newStatus1 = new Zend_Form_Element_Hidden('newStatus1');
     $description1 = new Zend_Form_Element_Hidden('description1');
     $totalamount1 = new Zend_Form_Element_Hidden('totalamount1');
     $confirm = new Zend_Form_Element_Submit('confirm');
     $confirm->setAttrib('class', 'officesubmit');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'officesubmit');
     $this->addElements(array($submit, $newStatus, $description, $accountCode, $memberId, $categoryId, $totalamount, $confirm, $newStatus1, $description1, $totalamount1));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:28,代码来源:statusForm.php

示例14: init

 public function init()
 {
     $holidayname = new Zend_Form_Element_Text('holidayname');
     $holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname'));
     $holidayname->setAttrib('class', 'txt_put');
     $holidayname->setRequired(true)->addValidators(array(array('NotEmpty')));
     $office_id = new Zend_Form_Element_Select('office_id');
     $office_id->addMultiOption('', 'Select...');
     $office_id->addMultiOption('All', 'All');
     $office_id->setAttrib('class', 'txt_put');
     $office_id->setRequired(true)->addValidators(array(array('NotEmpty')));
     $holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id');
     $holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom');
     $holidayfrom->setAttrib('class', 'txt_put');
     $holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd');
     $holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto');
     $holidayupto->setAttrib('class', 'txt_put');
     $holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd');
     $holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date');
     $repayment_date->setAttrib('class', 'txt_put');
     $repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd');
     $repayment_date->setRequired(true)->addValidators(array(array('NotEmpty')));
     array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->removeDecorator('DtDdWrapper');
     $this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:29,代码来源:Holiday.php

示例15: init

 public function init()
 {
     // contato_nome
     $contato_nome = new Zend_Form_Element_Text("contato_nome");
     $contato_nome->setLabel("Nome");
     $contato_nome->setRequired();
     $contato_nome->setAttribs(array('class' => 'form-control'));
     $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_email
     $contato_email = new Zend_Form_Element_Text("contato_email");
     $contato_email->setLabel("E-mail");
     $contato_email->setRequired();
     $contato_email->setAttribs(array('class' => 'form-control'));
     $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_assunto
     $contato_assunto = new Zend_Form_Element_Select("contato_assunto");
     $contato_assunto->setLabel("Assunto");
     $contato_assunto->setRequired();
     $contato_assunto->setAttribs(array('class' => 'form-control'));
     $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros"));
     // contato_mensagem
     $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem");
     $contato_mensagem->setLabel("mensagem");
     $contato_mensagem->setRequired();
     $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5));
     $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem));
     parent::init();
 }
开发者ID:nandorodpires2,项目名称:naopresta,代码行数:30,代码来源:Contato.php


注:本文中的Zend_Form_Element_Select::setRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。