當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Form_Element_Select::addDecorators方法代碼示例

本文整理匯總了PHP中Zend_Form_Element_Select::addDecorators方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Form_Element_Select::addDecorators方法的具體用法?PHP Zend_Form_Element_Select::addDecorators怎麽用?PHP Zend_Form_Element_Select::addDecorators使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Form_Element_Select的用法示例。


在下文中一共展示了Zend_Form_Element_Select::addDecorators方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: _addSelect

 /**
  * Add a select (dropdown list) element to the form.
  *
  * @param array $question
  *
  * @return void
  */
 private function _addSelect($question)
 {
     $elemName = $question['FQT_TypeName'] . self::UNDERSCORE . $question['FQ_ElementID'];
     $element = new Zend_Form_Element_Select($elemName);
     $element->removeDecorator('DtDdWrapper');
     $element->addDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'answer-zone'))));
     $element->setAttrib('class', 'stdSelect');
     $this->_addExtras($element, $question);
     $this->addElement($element);
     $this->_displayGroupElements[] = $elemName;
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:18,代碼來源:FormFront.php


注:本文中的Zend_Form_Element_Select::addDecorators方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。