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


PHP Zend_Form_Element_Text::addDecorators方法代码示例

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


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

示例1: _buildElements

 private function _buildElements()
 {
     $date = new Zend_Form_Element_Text($this->_name . "_Date");
     $date->setLabel("Date de publication");
     $date->addValidator(new Zend_Validate_Date(array("format" => "dd/MM/yyyy hh:mm")), true);
     $date->setDescription("JJ/MM/AAAA hh:mm");
     $date->setAttrib("size", 16);
     $date->addDecorators(array("br" => new Zend_Form_Decorator_HtmlTag(array("tag" => "br", "noAttribs" => true)), "hr" => new Zend_Form_Decorator_HtmlTag(array("tag" => "hr", "noAttribs" => true))));
     $active = new Zend_Form_Element_Checkbox($this->_name . "_Active");
     $active->setLabel("Est Actif");
     $active->removeDecorator("dtDdWrapper");
     $submit = new Zend_Form_Element_Submit($this->_name . "_Submit");
     $submit->setLabel("Creer");
     return array($date, $active, $submit);
 }
开发者ID:esandre,项目名称:CoeurDeTruffes,代码行数:15,代码来源:Add.php

示例2: _buildTranslateFields

 private function _buildTranslateFields()
 {
     $finalArray = array();
     foreach ($this->_localeLanguageTable->getList() as $locale) {
         $titre = new Zend_Form_Element_Text($this->_name . "_Titre_" . $locale);
         $titre->setLabel("Titre " . $locale);
         $titre->addDecorators(array("article" => new Zend_Form_Decorator_HtmlTag(array("tag" => "article", "openOnly" => true)), "br" => new Zend_Form_Decorator_HtmlTag(array("tag" => "br", "noAttribs" => true)), "hr" => new Zend_Form_Decorator_HtmlTag(array("tag" => "hr", "noAttribs" => true))));
         $text = new Zend_Form_Element_Textarea($this->_name . "_Text_" . $locale);
         $text->setLabel("Texte " . $locale);
         $text->addDecorators(array("article" => new Zend_Form_Decorator_HtmlTag(array("tag" => "article", "closeOnly" => true))));
         $finalArray[] = $titre;
         $finalArray[] = $text;
     }
     return $finalArray;
 }
开发者ID:esandre,项目名称:CoeurDeTruffes,代码行数:15,代码来源:Modif.php

示例3: init

 public function init()
 {
     $this->clearDecorators();
     $this->setMethod("post");
     // user
     $user = new Zend_Form_Element_Text('user');
     $user->setLabel('User');
     $user->setRequired(true);
     //$name->addValidator('alnum');
     $user->addDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td'))));
     $this->addElement($user);
     // password
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('Password');
     $password->setRequired(true);
     //$name->addValidator('alnum');
     $password->addDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td'))));
     $this->addElement($password);
 }
开发者ID:asmaklad,项目名称:knowledgeroot,代码行数:19,代码来源:Login.php

示例4: init

 public function init()
 {
     // cliente_id
     $cliente_id = new Zend_Form_Element_Select('cliente_id');
     $cliente_id->setLabel('Cliente: ');
     $cliente_id->setMultiOptions($this->getClientes());
     $cliente_id->addDecorators(Form_Decorators::$simpleElementDecorators);
     $cliente_id->setRequired();
     // senha_tipo_id
     $senha_tipo_id = new Zend_Form_Element_Select('senha_tipo_id');
     $senha_tipo_id->setLabel('Tipo Senha: ');
     $senha_tipo_id->setMultiOptions($this->getSenhasTipo());
     $senha_tipo_id->setRequired();
     $senha_tipo_id->addDecorators(Form_Decorators::$simpleElementDecorators);
     // senha_host
     $senha_host = new Zend_Form_Element_Text('senha_host');
     $senha_host->setLabel('Host: ');
     $senha_host->setRequired();
     $senha_host->addDecorators(Form_Decorators::$simpleElementDecorators);
     // senha_usuario
     $senha_usuario = new Zend_Form_Element_Text('senha_usuario');
     $senha_usuario->setLabel('Usuário: ');
     $senha_usuario->setRequired();
     $senha_usuario->addDecorators(Form_Decorators::$simpleElementDecorators);
     // senha_senha
     $senha_senha = new Zend_Form_Element_Text('senha_senha');
     $senha_senha->setLabel('Senha: ');
     $senha_senha->setRequired();
     $senha_senha->addDecorators(Form_Decorators::$simpleElementDecorators);
     // senha_observacao
     $senha_observacao = new Zend_Form_Element_Textarea('senha_observacao');
     $senha_observacao->setLabel('Observações: ');
     $senha_observacao->setAttrib('rows', 10);
     // submit
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Cadastrar');
     $submit->setAttribs(array('id' => 'btn-nova-senha', 'class' => 'btn btn-sm btn-info form-control'));
     // add elements
     $this->addElements(array($cliente_id, $senha_tipo_id, $senha_host, $senha_usuario, $senha_senha, $senha_observacao, $submit));
     // set defaults form attribs
     $this->setDefaultAttribs();
 }
开发者ID:nandorodpires2,项目名称:k-sys,代码行数:42,代码来源:Add.php

示例5: __construct

 public function __construct($options = null)
 {
     $decorator = new My_Decorator_SimpleInput();
     parent::__construct($options);
     $this->setDecorators(array('FormElements', 'Fieldset', 'Form'));
     $this->setName('datepicker');
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date');
     $datefrom->addDecorators(array($decorator));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date');
     $dateto->addDecorators(array($decorator));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'datepick');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('Label');
     $this->addElements(array($datefrom, $dateto, $submit));
     $this->setLegend('Choose your own dates: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:22,代码来源:DatePickerForm.php

示例6: __construct

 public function __construct($options, $levelno)
 {
     if ($options == 0) {
         $ZendTranslate = Zend_Registry::get('Zend_Translate');
         $officeNo = new Zend_Form_Element_Select('officeNo');
         $officeNo->setRequired(true);
         $officeNo->addMultiOption('', $ZendTranslate->_('select') . '...');
         $officeNo->addMultiOption('2', '2');
         $officeNo->addMultiOption('3', ' 3');
         $officeNo->addMultiOption('4', ' 4');
         $officeNo->addMultiOption('5', ' 5');
         $officeNo->addMultiOption('6', ' 6');
         $officeNo->addMultiOption('7', ' 7');
         $officeNo->addMultiOption('8', ' 8');
         $officeNo->addMultiOption('9', ' 9');
         $officeNo->addMultiOption('10', ' 10');
         $officeNo->setAttrib('class', 'selectbutton');
         $officeType = new Zend_Form_Element_Text('officeType1');
         $officeType->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officeType->setAttrib('class', 'txt_put');
         $officeType->setAttrib('id', 'officeType1');
         $officeCode = new Zend_Form_Element_Text('officeCode1');
         $officeCode->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officeCode->setAttrib('class', 'txt_put');
         $officeCode->setAttrib('id', 'officeCode1')->setAttrib('size', '2');
         $this->addElements(array($officeType, $officeCode));
         for ($i = 2; $i <= $levelno; $i++) {
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $officeType = new Zend_Form_Element_Text('officeType' . $i);
             $officeType->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officeType->setAttrib('class', 'txt_put');
             $officeType->setAttrib('id', 'officeType' . $i);
             $officeCode = new Zend_Form_Element_Text('officeCode' . $i);
             $officeCode->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officeCode->setAttrib('class', 'txt_put');
             $officeCode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officeType, $officeCode));
         }
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setAttrib('class', 'officesubmit');
         $submit->setLabel('edit');
         $this->addElements(array($submit));
         $this->addElements(array($officeNo));
     } else {
         /**this create form to display existed Office hierarchy*/
         for ($i = 1; $i <= $options; $i++) {
             $db_lookup_validator = new Zend_Validate_Db_NoRecordExists('ourbank_officehierarchy', 'officetype');
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $hierarchyLevel = new Zend_Form_Element_Hidden('hierarchyLevel' . $i);
             $officeType = new Zend_Form_Element_Text('officeType' . $i);
             $officeType->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
             $officeType->setAttrib('class', 'txt_put');
             $officeType->setAttrib('id', 'officeType' . $i);
             $officeCode = new Zend_Form_Element_Text('officeCode' . $i);
             $officeCode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
             $officeCode->setAttrib('class', 'txt_put');
             $officeCode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officeType, $officeCode, $hierarchyLevel));
         }
         $officeNo = new Zend_Form_Element_Hidden('officeNo');
         $OfficeLevel = new Zend_Form_Element_Text('officeLevel');
         $OfficeLevel->setAttrib('size', '2');
         $OfficeLevel->setAttrib('id', 'officeLevel');
         $OfficeLevel->setAttrib('class', 'txt_put');
         $OfficeLevel->addDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'h')), array('Label', array('tag' => 'h'))));
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setAttrib('class', 'officebutton');
         $submit->setLabel('edit');
         $next = new Zend_Form_Element_Submit('Next');
         $next->setAttrib('class', 'officesubmit');
         $next->setLabel('Next');
         $this->addElements(array($submit, $officeNo, $OfficeLevel, $next));
     }
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:74,代码来源:Hierarchy1.php

示例7: __construct

 public function __construct($options, $levelno)
 {
     parent::__construct($options);
     $this->setName('updateloanscheme');
     //set drop down and validate
     if ($options == 0) {
         $OFFICE_NO = new Zend_Form_Element_Select('officeNo');
         $OFFICE_NO->setRequired(true);
         $OFFICE_NO->addMultiOption('', 'Select...');
         $OFFICE_NO->addMultiOption('3', ' 3');
         $OFFICE_NO->addMultiOption('4', ' 4');
         $OFFICE_NO->addMultiOption('5', ' 5');
         $OFFICE_NO->addMultiOption('6', ' 6');
         $OFFICE_NO->addMultiOption('7', ' 7');
         $OFFICE_NO->addMultiOption('8', ' 8');
         $OFFICE_NO->addMultiOption('9', ' 9');
         $OFFICE_NO->addMultiOption('10', ' 10');
         $OFFICE_NO->setAttrib('class', 'selectbutton');
         $OFFICE_NO->setAttrib('onchange', 'reload(this.value)');
         $officetype = new Zend_Form_Element_Hidden('officeType1');
         $officetype->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officetype->setAttrib('class', 'txt_put');
         $officetype->setAttrib('id', 'officeType1');
         $officecode = new Zend_Form_Element_Hidden('officeCode1');
         $officecode->setRequired(true)->addValidators(array(array('NotEmpty')));
         $officecode->setAttrib('class', 'txt_put');
         $officecode->setAttrib('id', 'officeCode1')->setAttrib('size', '2');
         $this->addElements(array($officetype, $officecode));
         //set office levels
         for ($i = 2; $i <= $levelno; $i++) {
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $officetype = new Zend_Form_Element_Hidden('officeType' . $i);
             $officetype->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officetype->setAttrib('class', 'txt_put');
             $officetype->setAttrib('id', 'officeType' . $i);
             $officecode = new Zend_Form_Element_Hidden('officeCode' . $i);
             $officecode->setRequired(true)->addValidators(array(array('NotEmpty')));
             $officecode->setAttrib('class', 'txt_put');
             $officecode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officetype, $officecode));
         }
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setAttrib('class', 'officesubmit');
         $submit->setLabel('edit');
         $this->addElements(array($submit));
         $this->addElements(array($OFFICE_NO));
     } else {
         for ($i = 1; $i <= $options; $i++) {
             $id = new Zend_Form_Element_Hidden('id' . $i);
             $hierarchy_level = new Zend_Form_Element_Hidden('hierarchyLevel' . $i);
             $officetype = new Zend_Form_Element_Hidden('officeType' . $i);
             $officetype->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
             $officetype->setAttrib('class', 'txt_put');
             $officetype->setAttrib('id', 'officeType' . $i);
             $officecode = new Zend_Form_Element_Hidden('officeCode' . $i);
             //add validation and fix length
             $officecode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
             $officecode->setAttrib('class', 'txt_put');
             $officecode->setAttrib('id', 'officeCode' . $i)->setAttrib('size', '2');
             $this->addElements(array($id, $officetype, $officecode, $hierarchy_level));
         }
         $OFFICE_NO = new Zend_Form_Element_Hidden('officeNo');
         $Office_level = new Zend_Form_Element_Text('officeLevel');
         //add validation and fix length
         $Office_level->setAttrib('size', '2');
         $Office_level->setAttrib('id', 'officeLevel');
         $Office_level->setAttrib('class', 'txt_put');
         $Office_level->addDecorators(array('ViewHelper', 'Errors', array('HtmlTag', array('tag' => 'h')), array('Label', array('tag' => 'h'))));
         $submit = new Zend_Form_Element_Submit('Edit');
         $submit->setLabel('edit');
         $Next = new Zend_Form_Element_Submit('Next');
         //add submit button
         $submit->setAttrib('class', 'officebutton');
         $Next->setAttrib('class', 'officesubmit');
         $Next->setLabel('Next');
         $this->addElements(array($submit, $OFFICE_NO, $Office_level, $Next));
     }
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:78,代码来源:Hierarchy.php

示例8: _getSearchForm

 /**
  * Builds a search form
  * @return unknown_type
  */
 protected function _getSearchForm()
 {
     $form = new Zend_Form();
     $form->setAction($this->getUrl() . '/list');
     $form->setMethod('post');
     $elements = array();
     $element = new Zend_Form_Element_Select('key');
     $element->setMultiOptions($this->_searchOptions);
     $elements[] = $element;
     $element = new Zend_Form_Element_Text('value');
     $elements[] = $element;
     foreach ($elements as $element) {
         $element->addDecorators(array(array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td'))));
         $form->addElement($element);
     }
     $element = new Zend_Form_Element_Submit($this->_searchButtonLabel);
     $form->addElement($element);
     return $form;
 }
开发者ID:rogeriopradoj,项目名称:temostudo,代码行数:23,代码来源:Abstract.php

示例9: _addText

 /**
  * Add an input text element to the form.
  *
  * @param array $question
  *
  * @return void
  */
 private function _addText($question)
 {
     $elemName = $question['FQT_TypeName'] . self::UNDERSCORE . $question['FQ_ElementID'];
     $element = new Zend_Form_Element_Text($elemName);
     $element->removeDecorator('DtDdWrapper');
     $element->addDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'answer-zone'))));
     $element->setAttrib('class', 'stdTextInput');
     $this->_addExtras($element, $question);
     $this->addElement($element);
     $this->_displayGroupElements[] = $elemName;
 }
开发者ID:anunay,项目名称:stentors,代码行数:18,代码来源:FormFront.php


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