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


PHP Zend_Form_Element_Textarea::setOptions方法代码示例

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


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

示例1: init

 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $itemid = new Zend_Form_Element_Hidden('ItemID');
     $itemid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $maTS = new Zend_Form_Element_Text('MaTS');
     $maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $tenTS = new Zend_Form_Element_Text('TenTS');
     $tenTS->setOptions(array('label' => 'Tên tài sản', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $descr = new Zend_Form_Element_Textarea('Description');
     $descr->setOptions(array('label' => 'Mô tả', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $type = new Zend_Form_Element_Select('Type');
     $type->setOptions(array('label' => 'Loại bảo mật', 'required' => TRUE, 'MultiOptions' => array(1 => 'Bảo mật thấp', 0 => 'Bảo mật cao')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $startDate = new Zend_Form_Element_Text('StartDate');
     $startDate->setOptions(array('label' => 'Bắt đầu SD', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $price = new Zend_Form_Element_Text('Price');
     $price->setOptions(array('label' => 'Giá', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $warrantyTime = new Zend_Form_Element_Text('WarrantyTime');
     $warrantyTime->setOptions(array('label' => 'Bảo hành', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $status = new Zend_Form_Element_Select('Status');
     $status->setOptions(array('label' => 'Tình trạng', 'required' => TRUE, 'MultiOptions' => array(0 => 'Có thể mượn', 1 => 'Đang cho mượn', 2 => 'Hỏng')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $place = new Zend_Form_Element_Textarea('Place');
     $place->setOptions(array('label' => 'Địa điểm hiện tại', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($itemid, $maTS, $tenTS, $descr, $type, $startDate, $price, $warrantyTime, $status, $place))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
开发者ID:laiello,项目名称:mock-project,代码行数:27,代码来源:Item.php

示例2: init

 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $userid = new Zend_Form_Element_Hidden('UserID');
     $userid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $username = new Zend_Form_Element_Text('Username');
     $username->setOptions(array('label' => 'Username', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $birthday = new Zend_Form_Element_Text('Birthday');
     $birthday->setOptions(array('label' => 'Birthday', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $role = new Zend_Form_Element_Select('Role');
     $role->setOptions(array('label' => 'User Type', 'MultiOptions' => array(3 => 'User', 2 => 'IT', 1 => 'Admin', 0 => 'SuperAdmin')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $fullname = new Zend_Form_Element_Text('FullName');
     $fullname->setOptions(array('label' => 'FullName'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $email = new Zend_Form_Element_Text('Email');
     $email->setOptions(array('label' => 'Email', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $group = new Zend_Form_Element_Text('Group');
     $group->setOptions(array('label' => 'Group'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $phone = new Zend_Form_Element_Text('Phone');
     $phone->setOptions(array('label' => 'Phone'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $address = new Zend_Form_Element_Textarea('Address');
     $address->setOptions(array('label' => 'Address', 'style' => "width: 200px; height: 150px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('user-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($userid, $username, $role, $fullname, $email, $birthday, $group, $phone, $address))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
开发者ID:laiello,项目名称:mock-project,代码行数:25,代码来源:User.php

示例3: init

 /**
  * Overrides init() in Zend_Form
  * 
  * @access public
  * @return void
  */
 public function init()
 {
     // init the parent
     parent::init();
     // set the form's method
     $this->setMethod('post');
     $idMember = App_Utilities::getIdMember();
     $member_id = new Zend_Form_Element_Hidden('member_id');
     $member_id->addFilter('Int')->setValue($idMember);
     $this->addElement($member_id);
     $start_date = new Zend_Form_Element_Text('start_date');
     $start_date->setOptions(array('label' => $this->t('Start date'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($start_date);
     $end_date = new Zend_Form_Element_Text('end_date');
     $end_date->setOptions(array('label' => $this->t('End Date'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($end_date);
     $is_posted = new Zend_Form_Element_Checkbox('is_posted');
     $this->addElement($is_posted);
     $companyName = new Zend_Form_Element_Text('name');
     $companyName->setOptions(array('label' => $this->t('Company'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($companyName);
     $function = new Zend_Form_Element_Text('function');
     $function->setOptions(array('label' => $this->t('function'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($function);
     $mission = new Zend_Form_Element_Textarea('mission');
     $mission->setOptions(array('label' => $this->t('mission'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($mission);
     $city_name = new Zend_Form_Element_Text('city_name');
     $city_name->setOptions(array('label' => $this->t('city'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($city_name);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Save'), 'required' => true));
     $this->addElement($submit);
 }
开发者ID:omusico,项目名称:logica,代码行数:40,代码来源:ExperienceForm.php

示例4: init

 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $requestid = new Zend_Form_Element_Hidden('RequestID');
     $requestid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $maTS = new Zend_Form_Element_Text('MaTS');
     $maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     //
     //        $UserID = new Zend_Form_Element_Text('UserID');
     //        $UserID->setOptions(array(
     //                    'label' => 'UserID',
     //                    'required' => TRUE,
     //                    'filters' => array('StringTrim')
     //                ))
     //                ->setDecorators(array(
     //                    array('ViewHelper', array('helper' => 'formText')),
     //                    array('Label', array('class' => 'label'))
     //                ));
     $utype = new Zend_Form_Element_Select('Type');
     $utype->setOptions(array('label' => 'Loại yêu cầu', 'required' => TRUE, 'MultiOptions' => array(0 => 'Yêu cầu mượn TS', 1 => 'Yêu cầu nâng cấp')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $detail = new Zend_Form_Element_Textarea('Detail');
     $detail->setOptions(array('label' => 'Chi tiết yêu cầu', 'style' => "width: 200px; height: 100px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($requestid, $maTS, $utype, $detail))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
开发者ID:laiello,项目名称:mock-project,代码行数:26,代码来源:Request.php

示例5: init

 public function init()
 {
     $name = new Zend_Form_Element_Text('Name');
     $name->setOptions(array('label' => 'Name', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $email = new Zend_Form_Element_Text('Email');
     $email->setOptions(array('label' => 'Email', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $subject = new Zend_Form_Element_Select('Subject');
     $subject->setOptions(array('label' => 'Subject', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $content = new Zend_Form_Element_Textarea('Content');
     $content->setOptions(array('label' => 'Content', 'style' => "width: 300px; height: 200px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($name, $email, $subject, $content))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
开发者ID:laiello,项目名称:mock-project,代码行数:12,代码来源:Mail.php

示例6: __construct

 /**
  * @author code generate
  * @return mixed
  */
 public function __construct($option = array())
 {
     $contactId = new Zend_Form_Element_Hidden('ContactId');
     $contactId->setDecorators(array('ViewHelper'));
     $this->addElement($contactId);
     $contactName = new Zend_Form_Element_Text('ContactName');
     $contactName->setLabel('Họ tên *');
     $contactName->addFilter('StringTrim');
     $contactName->setRequired(true);
     $contactName->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $contactName->addValidator('stringLength', false, array(1, 50, "messages" => " dài tối đa 50 ký tự"));
     $this->addElement($contactName);
     $userId = new Zend_Form_Element_Text('UserId');
     $userId->setLabel('UserId');
     $userId->addFilter('StringTrim');
     $userId->setAttrib('disabled', true);
     $userId->setDecorators(array('ViewHelper'));
     $this->addElement($userId);
     $contactPhone = new Zend_Form_Element_Text('ContactPhone');
     $contactPhone->setLabel('Điện thoại *');
     $contactPhone->addFilter('StringTrim');
     $contactPhone->setRequired(true);
     $contactPhone->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $contactPhone->addValidator('stringLength', false, array(1, 15, "messages" => " dài tối đa 50 ký tự"));
     $this->addElement($contactPhone);
     $contactTitle = new Zend_Form_Element_Text('ContactTitle');
     $contactTitle->setLabel('Tiêu đề *');
     $contactTitle->addFilter('StringTrim');
     $contactTitle->setRequired(true);
     $contactTitle->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $contactTitle->addValidator('stringLength', false, array(1, 250, "messages" => " dài tối đa 250 ký tự"));
     $this->addElement($contactTitle);
     $contactContent = new Zend_Form_Element_Textarea('ContactContent');
     $contactContent->setLabel('Nội dung *');
     $contactContent->setRequired(true);
     $contactContent->setOptions(array('cols' => '10', 'rows' => '4'));
     $contactContent->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $contactPhone->addValidator('stringLength', false, array(1, 2000, "messages" => " dài tối đa 2000 ký tự"));
     $this->addElement($contactContent);
     $save = new Zend_Form_Element_Submit('Save');
     $save->setLabel('Gửi');
     $save->setAttrib('class', 'btn btn-primary');
     $save->setDecorators(array('ViewHelper'));
     $this->addElement($save);
     $reset = new Zend_Form_Element_Reset('Reset');
     $reset->setLabel('Làm lại');
     $reset->setAttrib('class', 'btn btn-primary');
     $reset->setDecorators(array('ViewHelper'));
     $this->addElement($reset);
 }
开发者ID:hocondoimeo,项目名称:giasu-tam.com,代码行数:54,代码来源:Contacts.php

示例7: init

 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $maTS = new Zend_Form_Element_Text('MaTS');
     $maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $Username = new Zend_Form_Element_Text('Username');
     $Username->setOptions(array('label' => 'Người mượn', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $detail = new Zend_Form_Element_Textarea('Detail');
     $detail->setOptions(array('label' => 'Chi tiết', 'style' => "width: 200px; height: 100px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $place = new Zend_Form_Element_Textarea('Place');
     $place->setOptions(array('label' => 'Địa điểm', 'style' => "width: 200px; height: 100px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($maTS, $Username, $detail, $place))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
开发者ID:laiello,项目名称:mock-project,代码行数:15,代码来源:Loan.php

示例8: init

 /**
  * Overrides init() in Zend_Form
  * 
  * @access public
  * @return void
  */
 public function init()
 {
     // init the parent
     parent::init();
     // set the form's method
     $this->setMethod('post');
     $idMember = App_Utilities::getIdMember();
     $member_id = new Zend_Form_Element_Hidden('member_id');
     $member_id->addFilter('Int')->setValue($idMember);
     $this->addElement($member_id);
     $file = new Zend_Form_Element_File('image_url');
     $file->setLabel('image')->setAttrib('enctype', 'multipart/form-data')->setDestination(APPLICATION_PATH . '/../public/frontend/images/profil/')->setRequired(false);
     $this->addElement($file);
     $profil_description = new Zend_Form_Element_Textarea('profil_description');
     $profil_description->setOptions(array('label' => $this->t('description'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($profil_description);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Save'), 'required' => true));
     $this->addElement($submit);
 }
开发者ID:omusico,项目名称:logica,代码行数:26,代码来源:ProfilDescription.php

示例9: init

 /**
  * Overrides init() in Zend_Form
  * 
  * @access public
  * @return void
  */
 public function init()
 {
     // init the parent
     parent::init();
     // set the form's method
     $this->setMethod('post');
     $nameCompany = new Zend_Form_Element_Text('name');
     $nameCompany->setOptions(array('label' => $this->t('Raison social'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($nameCompany);
     $synopsis = new Zend_Form_Element_Textarea('synopsis');
     $synopsis->setOptions(array('label' => $this->t('synopsis'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($synopsis);
     $file = new Zend_Form_Element_File('logo');
     $file->setLabel('image')->setAttrib('enctype', 'multipart/form-data')->setDestination(APPLICATION_PATH . '/../public/frontend/images/logo/')->setRequired(false);
     $this->addElement($file);
     $rc = new Zend_Form_Element_Text('rc');
     $rc->setOptions(array('label' => $this->t('rc'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($rc);
     $patente = new Zend_Form_Element_Text('patente');
     $patente->setOptions(array('label' => $this->t('patente'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($patente);
     $createDate = new Zend_Form_Element_Text('create_date');
     $createDate->setOptions(array('label' => $this->t('create_date'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($createDate);
     $tel = new Zend_Form_Element_Text('tel');
     $tel->setOptions(array('label' => $this->t('tel'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($tel);
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setOptions(array('label' => $this->t('fax'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($fax);
     $adress = new Zend_Form_Element_Text('adress');
     $adress->setOptions(array('label' => $this->t('adress'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($adress);
     $description = new Zend_Form_Element_Text('description');
     $description->setOptions(array('label' => $this->t('description'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($description);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Save'), 'required' => true));
     $this->addElement($submit);
 }
开发者ID:omusico,项目名称:logica,代码行数:46,代码来源:CompanyForm.php

示例10: elementTextarea

 /**
  * Zend_Form_Element_Textarea wrapper
  * @param string $title
  * @param string $label
  * @return Zend_Form_Element_Textarea
  */
 protected function elementTextarea($title, $options = null)
 {
     $el = new Zend_Form_Element_Textarea($title);
     if (is_array($options)) {
         $el->setOptions($options);
     } else {
         if (!empty($options)) {
             $el->setLabel($options);
         }
     }
     $el->setRequired(true)->addFilter('StringTrim')->addValidator('NotEmpty');
     return $el;
 }
开发者ID:BGCX262,项目名称:zx-zf-hg-to-git,代码行数:19,代码来源:Form.php

示例11: __construct


//.........这里部分代码省略.........
     $this->addElement($subject);
     $experienceYears = new Zend_Form_Element_Select('ExperienceYears');
     $experienceYears->setLabel('Số Năm Kinh Nghiệm *');
     $experienceYears->addFilter('StringTrim');
     $experienceYears->setRequired(false);
     $experienceYears->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $options = unserialize(EXPERIENCE_YEAR);
     //$experienceYears->addMultiOptions(array_combine($options, $options));
     $experienceYears->setMultiOptions(unserialize(EXPERIENCE_YEAR));
     $this->addElement($experienceYears);
     $career = new Zend_Form_Element_Select('Career');
     $career->setLabel('Hiện tại là *');
     $career->addFilter('StringTrim');
     $career->addValidator('Int');
     $career->setRequired(true);
     $career->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $career->setMultiOptions(unserialize(TUTOR_CAREERS));
     $this->addElement($career);
     $careerLocation = new Zend_Form_Element_Text('CareerLocation');
     $careerLocation->setLabel('Nơi Công Tác ( Giáo hoặc Giảng Viên ) *');
     $careerLocation->addFilter('StringTrim');
     $careerLocation->setRequired(false);
     $careerLocation->setAttrib('style', 'min-height: 30px;');
     $careerLocation->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $careerLocation->addValidator('stringLength', false, array(1, 100, "messages" => "Nơi Công Tác dài tối đa 100 ký tự"));
     $this->addElement($careerLocation);
     $teachableInClass = new Zend_Form_Element_Text('TeachableInClass');
     $teachableInClass->setLabel('Lớp Có Thể Dạy');
     $teachableInClass->addFilter('StringTrim');
     $teachableInClass->setRequired(false);
     $teachableInClass->setAttrib('disabled', true);
     $teachableInClass->setDescription('<a id="grades-modal" class="btn btn-info" title="Chọn lớp">...</a>');
     $teachableInClass->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElement($teachableInClass);
     $teachableSubjects = new Zend_Form_Element_Text('TeachableSubjects');
     $teachableSubjects->setLabel('Môn Có Thể Dạy');
     $teachableSubjects->addFilter('StringTrim');
     $teachableSubjects->setRequired(false);
     $teachableSubjects->setAttrib('disabled', true);
     $teachableSubjects->setDescription('<a id="subjects-modal" class="btn btn-info" title="Chọn môn">...</a>');
     $teachableSubjects->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElement($teachableSubjects);
     $teachableDistricts = new Zend_Form_Element_Text('TeachableDistricts');
     $teachableDistricts->setLabel('Khu Vực Có Thể Dạy');
     $teachableDistricts->addFilter('StringTrim');
     $teachableDistricts->setRequired(false);
     $teachableDistricts->setAttrib('disabled', true);
     $teachableDistricts->setDescription('<span id="districts-modal" class="btn btn-info" title="Chọn quận">...</span>');
     $teachableDistricts->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElement($teachableDistricts);
     $avatar = new Zend_Form_Element_Hidden('Upload');
     $avatar->setLabel('Hình đại diện');
     $avatar->setRequired(false);
     $avatar->setDescription('fieldlabel');
     $avatar->setDecorators(array('ViewHelper', array(array('Description' => 'HtmlTag'), array('tag' => 'div', 'id' => "file-uploader")), array(array('Errors' => 'HtmlTag'), array('placement' => 'append', 'tag' => 'img', 'id' => 'progress-img', 'src' => "/scripts/upload/loading.gif")), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control', 'style' => "position: relative;float: left;margin-left: 20px;")), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElement($avatar);
     $avatarNote = new Zend_Form_Element_Hidden('Avatar');
     $avatarNote->setLabel('Chú ý');
     $avatarNote->setRequired(false);
     $avatarNote->setDescription("Kích thước khoảng: 240 x 120 (px)<br>Kích cỡ cho phép: " . IMAGE_SIZE_LIMIT . " kB");
     $avatarNote->setDecorators(array('ViewHelper', array('Description', array('escape' => false, 'tag' => 'div')), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group', 'style' => "float: left;"))));
     $this->addElement($avatarNote);
     $introduction = new Zend_Form_Element_Textarea('Introduction');
     $introduction->setLabel('Giới thiệu bản thân');
     $introduction->addFilter('StringTrim');
     $introduction->setRequired(false);
     $introduction->setOptions(array('cols' => '10', 'rows' => '4'));
     /* $introduction->setDecorators(array('ViewHelper')); */
     $introduction->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $subject->addValidator('stringLength', false, array(1, 2000, "messages" => "Giới thiệu bản thân dài tối đa 2000 ký tự"));
     $this->addElement($introduction);
     $isDisabled = new Zend_Form_Element_Text('IsDisabled');
     $isDisabled->setLabel('IsDisabled');
     $isDisabled->addFilter('StringTrim');
     $isDisabled->addValidator('Int');
     $isDisabled->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElement($isDisabled);
     $submit = new Zend_Form_Element_Submit('Save');
     $submit->setLabel('Đăng ký');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setDecorators(array('ViewHelper'));
     $this->addElement($submit);
     $reset = new Zend_Form_Element_Reset('Reset');
     $reset->setLabel('Làm lại');
     $reset->setAttrib('class', 'btn btn-primary');
     $reset->setDecorators(array('ViewHelper'));
     $this->addElement($reset);
     $this->addDisplayGroup(array('UserName', 'Gender', 'Birthday', 'Email', 'Address', 'Phone'), 'contact', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin cá nhân'));
     $contact = $this->getDisplayGroup('contact');
     $contact->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset'))));
     $this->addDisplayGroup(array('Level', 'University', 'Subject', 'Career', 'CareerLocation', 'ExperienceYears'), 'level', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn'));
     $level = $this->getDisplayGroup('level');
     $level->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset'))));
     $this->addDisplayGroup(array('TeachableInClass', 'TeachableSubjects', 'TeachableDistricts', 'Upload', 'Avatar', 'Introduction'), 'extra', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin thêm'));
     $extra = $this->getDisplayGroup('extra');
     $extra->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset'))));
     $this->addDisplayGroup(array('Save', 'Reset'), 'submit', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn'));
     $submit = $this->getDisplayGroup('submit');
     $submit->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset'))));
 }
开发者ID:hocondoimeo,项目名称:giasu-tam.com,代码行数:101,代码来源:Tutors.php


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