本文整理汇总了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();
}
示例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;
}