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


PHP Select::setLabel方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('lov');
     $this->setAttribute('method', 'post');
     $this->add(new Element\Hidden('type_lov'));
     $new_type_lov = new Element\Text('new_type_lov');
     $new_type_lov->setLabel('List Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($new_type_lov);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $bool_translateable = new Element\Radio('bool_translateable');
     $bool_translateable->setLabel('Translateable')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_translateable);
     $bool_controlbypoxn = new Element\Radio('bool_controlbypoxn');
     $bool_controlbypoxn->setLabel('Control by Poxn')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_controlbypoxn);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:25,代码来源:LovChangeTypeForm.php

示例2: __construct

 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('communication');
     $this->add(new Element\Hidden('id_party'));
     $this->add(new Element\Hidden('nid_commtype'));
     $this->add(new Element\Hidden('access_detail'));
     $this->add(new Element\Hidden('access_form'));
     $this->setAttribute('method', 'post');
     $this->get('access_detail')->setLabel('Account / Number');
     $num_primary_order = new Element\Text('num_primary_order');
     $num_primary_order->setLabel('Number Primary Order')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($num_primary_order);
     $id_address = new Element\Select('id_address');
     $id_address->setLabel('Address')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'No Address Binded'));
     $this->add($id_address);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:26,代码来源:CommunicationEditForm.php

示例3: __construct

 public function __construct(ServiceLocatorInterface $sl)
 {
     parent::__construct('form-categoria');
     // instanciando o entity manager do doctrine
     $em = $sl->get('Doctrine\\ORM\\EntityManager');
     // definindo variáveis
     $arrPerfil = array('' => 'Selecione');
     $repoPerfil = $em->getRepository('Admin\\Entity\\Perfil');
     $arrPerfil += $repoPerfil->findPairs();
     $perfil = new Select('perfil');
     $perfil->setLabel('Perfil')->setAttributes(array('id' => 'perfil', 'class' => 'form-control', 'options' => $arrPerfil));
     $this->add($perfil);
     $nome = new Text('nome');
     $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control'));
     $this->add($nome);
     $email = new Text('email');
     $email->setLabel('Email')->setAttributes(array('id' => 'email', 'class' => 'form-control'));
     $this->add($email);
     $senha = new Text('senha');
     $senha->setLabel('Senha')->setAttributes(array('id' => 'senha', 'class' => 'form-control'));
     $this->add($senha);
     $status = new Select('status');
     $status->setLabel('Status')->setAttributes(array('id' => 'status', 'class' => 'form-control', 'options' => array('1' => 'Ativo', '0' => 'Inativo')));
     $this->add($status);
 }
开发者ID:RodrigoAngeloValentini,项目名称:curso-zf2,代码行数:25,代码来源:Usuario.php

示例4: __construct

 public function __construct()
 {
     parent::__construct('form-endereco');
     $collectionForm = new CollectionForm();
     $arrEstados = array("" => "Selecione o estado");
     $arrEstados += $collectionForm->getEstados();
     $nome = new Text('nome');
     $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control input-lg', 'placeholder' => 'Ex. Minha casa, Escritório, etc'));
     $this->add($nome);
     $logradouro = new Text('logradouro');
     $logradouro->setLabel('Endereço')->setAttributes(array('id' => 'logradouro', 'class' => 'form-control input-lg', 'placeholder' => 'Ex. Rua Itaipava'));
     $this->add($logradouro);
     $numero = new Text('numero');
     $numero->setLabel('Número')->setAttributes(array('id' => 'numero', 'class' => 'form-control input-lg', 'placeholder' => 'Digite o número do endereço'));
     $this->add($numero);
     $complemento = new Text('complemento');
     $complemento->setLabel('Complemento')->setAttributes(array('id' => 'complemento', 'class' => 'form-control input-lg', 'placeholder' => 'Informe o complemento caso seja necessário'));
     $this->add($complemento);
     $bairro = new Text('bairro');
     $bairro->setLabel('Bairro')->setAttributes(array('id' => 'bairro', 'class' => 'form-control input-lg', 'placeholder' => 'Digite o nome seu bairro'));
     $this->add($bairro);
     $cidade = new Text('cidade');
     $cidade->setLabel('Cidade')->setAttributes(array('id' => 'cidade', 'class' => 'form-control input-lg', 'placeholder' => 'Digite o nome da sua cidade'));
     $this->add($cidade);
     $estado = new Select('estado');
     $estado->setLabel('Estado')->setAttributes(array('id' => 'estado', 'class' => 'form-control input-lg', 'options' => $arrEstados));
     $this->add($estado);
     $cep = new Text('cep');
     $cep->setLabel('CEP.:')->setAttributes(array('id' => 'cep', 'class' => 'form-control input-lg', 'placeholder' => 'Digite o seu CEP.'));
     $this->add($cep);
 }
开发者ID:RodrigoAngeloValentini,项目名称:curso-zf2,代码行数:31,代码来源:Endereco.php

示例5: __construct

 public function __construct($name = null, array $pais = null)
 {
     parent::__construct($name);
     $this->pais = $pais;
     $this->setAttribute('method', 'POST');
     $id = new \Zend\Form\Element\Hidden('id');
     $this->add($id);
     $nome = new Text('nome');
     $nome->setLabel('Nome')->setAttribute('placeholder', 'Entre com a nome')->setAttribute('maxlength', 100)->setAttribute('size', 50)->setAttribute('autofocus', 'autofocus');
     $this->add($nome);
     $email = new Text('email');
     $email->setLabel('E-mail')->setAttribute('placeholder', 'Entre com o email')->setAttribute('maxlength', 255)->setAttribute('size', 50);
     $this->add($email);
     $celular = new Text('celular');
     $celular->setLabel('Telefone')->setAttribute('placeholder', 'Entre com o telefone')->setAttribute('maxlength', 15);
     $this->add($celular);
     $ativo = new Checkbox('ativo');
     $ativo->setLabel('Ativo : ');
     $this->add($ativo);
     $pai = new Select();
     $pai->setLabel("Pai ")->setName("pessoa")->setOptions(array('value_options' => $pais));
     $this->add($pai);
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success'));
     $this->add($button);
 }
开发者ID:souzagabi,项目名称:Agenda,代码行数:26,代码来源:FilhoForm.php

示例6: __construct

 public function __construct($serviceLocator, $options = null)
 {
     parent::__construct('fTransaction');
     $this->setServiceLocator($serviceLocator);
     $this->setAttribute('method', 'post');
     $filter = $this->getInputFilter();
     $basicGroup = new DisplayGroup('basicGroup');
     $this->add($basicGroup);
     $companyId = $this->addElementCompany('companyId', $basicGroup, ['required' => true]);
     $applyDate = new Text('applyDate');
     $applyDate->setLabel('Ngày hạch toán:');
     $applyDate->setAttribute('class', 'datepicker');
     $this->add($applyDate);
     $basicGroup->addElement($applyDate);
     $applyDate->setValue(DateBase::toDisplayDate(DateBase::getCurrentDate()));
     $filter->add(array('name' => 'applyDate', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập ngày hạch toán'))))));
     $description = new Text('description');
     $description->setLabel('Nội dung:');
     $this->add($description);
     $basicGroup->addElement($description);
     $filter->add(array('name' => 'description', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập nội dung phiếu thu'))))));
     $accountId = new Select('accountId');
     $accountId->setLabel('Quỹ thu:');
     $accountId->setValueOptions(['' => '- Quỹ thu -']);
     $this->loadAccountingAccount($accountId, $companyId);
     $this->add($accountId);
     $basicGroup->addElement($accountId);
     $filter->add(array('name' => 'accountId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập quỹ thu'))), array('name' => 'InArray', 'break_chain_on_failure' => true, 'options' => array('haystack' => array_keys($accountId->getValueOptions()), 'messages' => array('notInArray' => 'Bạn chưa nhập quỹ thu'))))));
     $items = new Hidden('items');
     $this->add($items);
     $filter->add(array('name' => 'items', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập chi tiết các khoản thu'))))));
     $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/accounting/transaction/addreqrecieve'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/accounting/transaction/addreqrecieve' => 'Tiếp tục nhập', '/accounting/transaction/index' => 'Hiện danh sách vừa nhập'))));
     $this->add(array('name' => 'btnSubmit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'button', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary')));
 }
开发者ID:NguyenQuiDuong,项目名称:Funixtest,代码行数:34,代码来源:ReqRecieve.php

示例7: __construct

 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('BankDetailsForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-horizontal');
     $city = new Element\Select('cityId');
     $city->setLabel('city');
     $city->setValueOptions($this->getOptionCity());
     $city->setAttribute("class", "dropDnInput");
     $city->setAttribute("id", "cityId");
     $city->setDisableInArrayValidator(true);
     $this->add($city);
     $bankName = new Element\Select('bankName');
     $bankName->setLabel('Bank Name');
     $bankName->setValueOptions($this->getOptionBankNames());
     $bankName->setAttribute("class", "dropDnInput");
     $this->add($bankName);
     $this->add(array('name' => 'branchName', 'attributes' => array('type' => 'text', 'placeholder' => 'Branch Name', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'ifscCode', 'attributes' => array('type' => 'text', 'placeholder' => 'IFSC code', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
开发者ID:viplovegithub,项目名称:Myzend,代码行数:33,代码来源:BankDetailsForm.php

示例8: getForm

 public function getForm(array $urlType)
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new Form();
     $form->setAttribute('class', 'form-horizontal');
     $form->setAttribute('role', 'form');
     $form->add(array('name' => 'menuId', 'type' => 'Hidden'));
     $form->add(array('name' => 'title', 'type' => 'text', 'options' => array('label' => 'Title'), 'attributes' => array('class' => 'form-control')));
     $form->add(array('name' => 'description', 'type' => 'Textarea', 'options' => array('label' => 'Description'), 'attributes' => array('class' => 'form-control', 'placeholder' => 'description')));
     $form->add(array('name' => 'icon', 'type' => 'text', 'options' => array('label' => 'Icon'), 'attributes' => array('class' => 'form-control', 'placeholder' => 'Icon Class')));
     $form->add(array('name' => 'url', 'type' => 'text', 'options' => array('label' => 'Url'), 'attributes' => array('class' => 'form-control', 'placeholder' => 'Url')));
     $url_type = new Select('url_type');
     $url_type->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($urlType)->setEmptyOption('-- Choose URL Type --');
     $form->add($url_type);
     $hasDivider = new Checkbox('hasDivider');
     $hasDivider->setLabel('Has divider?');
     $form->add($hasDivider);
     $form->add(array('name' => 'parentId', 'type' => 'hidden'));
     $form->add(array('name' => 'priority', 'type' => 'number', 'options' => array('label' => 'Priority'), 'attributes' => array('class' => 'form-control')));
     $form->setInputFilter($this->getInputFilter());
     $this->form = $form;
     return $this->form;
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:25,代码来源:MenuHelper.php

示例9: __construct

 public function __construct($name = null, array $modulos = null)
 {
     parent::__construct('aula');
     $this->modulos = $modulos;
     $this->setInputFilter(new AulaFilter());
     $this->setAttribute('method', 'post');
     $id = new \Zend\Form\Element\Hidden('id');
     $this->add($id);
     $descricao = new \Zend\Form\Element\Text("descricao");
     $descricao->setLabel("Descricao: ")->setAttribute('placeholder', 'Entre com a descrição');
     $this->add($descricao);
     $modulo = new Select();
     $modulo->setLabel("Modulo: ")->setName("modulo")->setOptions(array('value_options' => $this->modulos));
     $this->add($modulo);
     $videos = new \Zend\Form\Element\Text("videos");
     $videos->setLabel("Dados Videos: ")->setAttribute('placeholder', 'Entre com os dados do video');
     $this->add($videos);
     $allSituacao = array_merge(array(0 => 'DESATIVADO', 1 => 'ATIVADO'));
     $situacao = new Select();
     $situacao->setLabel("Situacao: ")->setName("situacao")->setOptions(array('value_options' => $allSituacao));
     $this->add($situacao);
     $material = new \Zend\Form\Element\Text("material");
     $material->setLabel("Mateirla")->setAttribute('placeholder', 'Entre com a URL do Material');
     $this->add($material);
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Salvar', 'class' => 'btn-success')));
 }
开发者ID:feijojr,项目名称:EADGestao,代码行数:26,代码来源:Aula.php

示例10: __construct

 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('Attachment');
     $this->add(new Element\Hidden('target_type_object'));
     $this->add(new Element\Hidden('target_id_row'));
     $this->setAttribute('method', 'post');
     $nid_lov_attachmenttype = new Element\Select('nid_lov_attachmenttype');
     $nid_lov_attachmenttype->setLabel('Attachment Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('' => 'Select a attachment type'));
     $this->add($nid_lov_attachmenttype);
     $url_or_filepath = new Element\Text('url_or_filepath');
     $url_or_filepath->setLabel('Url or file path')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($url_or_filepath);
     $filename = new Element\Text('filename');
     $filename->setLabel('File Name')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($filename);
     $filesize = new Element\Text('filesize');
     $filesize->setLabel('File Size')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($filesize);
     $mimetype = new Element\Text('mimetype');
     $mimetype->setLabel('Mime Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($mimetype);
     $bool_active = new Element\Radio('bool_active');
     $bool_active->setLabel('Is Active?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'))->setAttributes(array('class' => 'medwhite'));
     $this->add($bool_active);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:35,代码来源:AttachmentForm.php

示例11: __construct

 public function __construct($name = null)
 {
     parent::__construct('usuariosform');
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $this->setAttributes(array('id' => 'usuariosform'));
     $usuarios_id = new Element('usuarios_id');
     $usuarios_id->setLabel('ID');
     $usuarios_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'usuarios_id', 'readonly' => 'readonly', 'class' => 'form-control'));
     $usuarios_username = new Element('usuarios_username');
     $usuarios_username->setLabel('Usuario');
     $usuarios_username->setAttributes(array('type' => 'text', 'placeholder' => 'dvader', 'id' => 'usuarios_username', 'class' => 'form-control'));
     $usuarios_nombres = new Element('usuarios_nombres');
     $usuarios_nombres->setLabel('Nombre');
     $usuarios_nombres->setAttributes(array('type' => 'text', 'placeholder' => 'Darth Vader', 'id' => 'usuarios_nombres', 'class' => 'form-control'));
     $usuarios_estado = new Element\Select('usuarios_estado');
     $usuarios_estado->setLabel('Estado');
     //$usuarios_estado->setEmptyOption('ELige un Estado..');
     $usuarios_estado->setOptions(array('disable_inarray_validator' => true));
     $usuarios_estado->setAttributes(array('id' => 'usuarios_estado', 'class' => "form-control", 'data-rule-required' => "true", 'data-msg-required' => "Debe seleccionar el Estado"));
     $guardar = new Element\Button('guardar');
     $guardar->setAttributes(array('class' => 'btn btn-success mr5', 'type' => 'submit', 'id' => 'guardar'));
     $guardar->setOptions(array('label' => '<i class="glyphicon glyphicon-floppy-disk"></i>', 'label_options' => array('disable_html_escape' => true)));
     $this->add($usuarios_id);
     $this->add($usuarios_username);
     $this->add($usuarios_nombres);
     $this->add($usuarios_estado);
     $this->add($guardar);
 }
开发者ID:Crisstthian,项目名称:Reminder,代码行数:29,代码来源:UsuariosForm.php

示例12: __construct

 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('resp');
     $this->setAttribute('method', 'post');
     $name_resp = new Element\Text('name_resp');
     $name_resp->setLabel('Responsibility')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($name_resp);
     $nid_lov_resptype = new Element\Select('nid_lov_resptype');
     $nid_lov_resptype->setLabel('Type')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a type'));
     $this->add($nid_lov_resptype);
     $nid_timezone = new Element\Select('nid_timezone');
     $nid_timezone->setLabel('Time Zone')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a timezone'));
     $this->add($nid_timezone);
     $id_locale = new Element\Select('nid_locale');
     $id_locale->setLabel('Locale')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a locale'));
     $this->add($id_locale);
     $nid_language = new Element\Select('nid_language');
     $nid_language->setLabel('Language')->setAttributes(array('class' => 'form-control input-sm'))->setValueOptions(array('0' => 'Select a language'));
     $this->add($nid_language);
     $comment = new Element\Textarea('comment');
     $comment->setLabel('Comment')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($comment);
     $back = new Element\Button('back');
     $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn btn-primary btn-sm', 'onclick' => ''));
     $this->add($back);
     $submit = new Element\Submit('submit');
     $submit->setValue('Go')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn btn-primary btn-sm'));
     $this->add($submit);
 }
开发者ID:shiqizhang,项目名称:php-sample,代码行数:30,代码来源:RespForm.php

示例13: init

 public function init()
 {
     $this->setMethod('POST');
     $element = new Element\Text('title');
     $element->setLabel('Title:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Select('name');
     $element->setLabel('Directory:');
     $element->setRequired(true);
     $element->addMultiOptions($this->model->getThemesDirectoriesFromFS());
     $this->addElement($element);
     $element = new Element\Radio('active');
     $element->setSeparator('&nbsp;');
     $element->setLabel('Active:');
     $element->setValue(false);
     $element->setMultiOptions(array('1' => 'Yes', '0' => 'No'));
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('ordering');
     $element->setLabel('Ordering:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Submit('submit');
     $element->setLabel('Save');
     $element->setIgnore(true);
     $this->addElement($element);
 }
开发者ID:zendmaniacs,项目名称:zly-templater,代码行数:28,代码来源:Theme.php

示例14: __construct

 /**
  * @param null|string $productName
  */
 public function __construct($serviceLocator, $options = null)
 {
     parent::__construct('crmContract');
     $this->setServiceLocator($serviceLocator);
     $this->setAttribute('method', 'post');
     $filter = $this->getInputFilter();
     $mainBasic = new DisplayGroup('mainBasic');
     $mainBasic->setLabel('Sản phẩm mẫu');
     $this->add($mainBasic);
     $todeleteBasic = new DisplayGroup('todeleteBasic');
     $todeleteBasic->setLabel('Sản phẩm sẽ xóa');
     $this->add($todeleteBasic);
     $mainCompanyId = $this->addElementCompany('mainCompanyId', $mainBasic, ['required' => true]);
     $mainProductId = new Select('mainProductId');
     $mainProductId->setLabel('Sản phẩm mẫu:');
     $this->add($mainProductId);
     $mainBasic->addElement($mainProductId);
     $this->loadProducts($mainProductId, $mainCompanyId, $options);
     $filter->add(array('name' => 'mainProductId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập sản phẩm'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'Dữ liệu sản phẩm không hợp lệ'))))));
     $toDeleteCompanyId = $this->addElementCompany('toDeleteCompanyId', $todeleteBasic, ['required' => true]);
     $toDeleteProductId = new Select('toDeleteProductId');
     $toDeleteProductId->setLabel('Sản phẩm sẽ xóa:');
     $this->add($toDeleteProductId);
     $todeleteBasic->addElement($toDeleteProductId);
     $this->loadProducts($toDeleteProductId, $toDeleteCompanyId, $options);
     $filter->add(array('name' => 'toDeleteProductId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập sản phẩm'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'Dữ liệu sản phẩm không hợp lệ'))))));
     $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Hợp nhất', 'id' => 'btnSaveCrmContract', 'class' => 'btn btn-primary btnSaveCrmContract')));
 }
开发者ID:NguyenQuiDuong,项目名称:Funixtest,代码行数:31,代码来源:MergerProduct.php

示例15: prepareElements

 public function prepareElements(array $categories)
 {
     $category = new Element\Select('category');
     $category->setLabel('Category')->setOptions(array('options' => $categories));
     $title = new Element\Text('title');
     $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 40)->setAttribute('maxlength', 128);
     $priceMin = new Element\Text('priceMin');
     $priceMin->setLabel('Minimum Price')->setAttribute('title', 'Enter mininum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $priceMax = new Element\Text('priceMax');
     $priceMax->setLabel('Maximum Price')->setAttribute('title', 'Enter maximum price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $expires = new Element\Date('expires');
     $expires->setLabel('Expires')->setAttribute('title', 'The expiration date will be calculated from today')->setAttribute('size', 20)->setAttribute('maxlength', 20);
     $city = new Element\Text('city');
     $city->setLabel('Nearest City')->setAttribute('title', 'Select the city of the item')->setAttribute('size', 40)->setAttribute('maxlength', 255);
     $country = new Element\Text('country');
     $country->setLabel('Country Code')->setAttribute('title', 'Enter the 2 character ISO2 country code of the item')->setAttribute('size', 2)->setAttribute('maxlength', 2);
     $name = new Element\Text('name');
     $name->setLabel('Contact Name')->setAttribute('title', 'Enter the name of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255);
     $phone = new Element\Text('phone');
     $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Enter the phone number of the person to contact for this item')->setAttribute('size', 20)->setAttribute('maxlength', 32);
     $email = new Element\Email('email');
     $email->setLabel('Contact Email')->setAttribute('title', 'Enter the email address of the person to contact for this item')->setAttribute('size', 40)->setAttribute('maxlength', 255);
     $description = new Element\Textarea('description');
     $description->setLabel('Description')->setAttribute('title', 'Enter a suitable description for this posting')->setAttribute('rows', 4)->setAttribute('cols', 80);
     $submit = new Element\Submit('submit');
     $submit->setAttribute('value', 'Search')->setAttribute('title', 'Click here when done');
     $this->add($category)->add($title)->add($priceMin)->add($priceMax)->add($expires)->add($city)->add($country)->add($name)->add($phone)->add($email)->add($description)->add($submit);
 }
开发者ID:lohmuller,项目名称:OnlineMarket,代码行数:28,代码来源:SearchForm.php


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