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); }
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); }
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); }
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); }
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); }
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'))); }
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' // ), // )); }
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; }
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'))); }
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); }
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); }
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); }
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(' '); $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); }
/** * @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'))); }
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); }
/** * Init Module form * * @return void */ public function init() { $this->setAttribute('class', 'relative'); $fileInfo = new Info(); $modulesInfos = array(); $options = array('' => 'Select an option'); foreach ($this->getServiceLocator()->get('ModulesList') as $path => $dir) { $options[$dir] = $dir; $configFile = $path . '/module.info'; if ($fileInfo->fromFile($configFile) === true) { $modulesInfos[$dir] = $fileInfo->render(); } } $collection = new ModuleCollection(); $modules = $collection->getModules(); foreach ($modules as $module) { if (in_array($module->getName(), $options)) { unset($options[$module->getName()]); unset($modulesInfos[$module->getName()]); } } $module = new Element\Select('module'); $module->setLabel('Module')->setLabelAttributes(array('class' => 'required')); $module->setAttribute('id', 'module')->setAttribute('class', 'form-control')->setAttribute('modules_info', $modulesInfos)->setValueOptions($options); $this->add($module); $inputFilterFactory = new InputFilterFactory(); $inputFilter = $inputFilterFactory->createInputFilter(array('module' => array('name' => 'module', 'required' => true, 'validators' => array(array('name' => 'not_empty'))))); $this->setInputFilter($inputFilter); }
public function __construct() { parent::__construct('add'); $hydrator = new AggregateHydrator(); $hydrator->add(new PostHydrator()); $hydrator->add(new CategoryHydrator()); $this->setHydrator($hydrator); $title = new Element\Text('title'); $title->setLabel('Title'); $title->setAttribute('class', 'form-control'); $slug = new Element\Text('slug'); $slug->setLabel('Slug'); $slug->setAttribute('class', 'form-control'); $content = new Element\Textarea('content'); $content->setLabel('Content'); $content->setAttribute('class', 'form-control'); $category = new Element\Select('category_id'); $category->setLabel('Category'); $category->setAttribute('class', 'form-control'); $category->setValueOptions(array(1 => 'WIN', 2 => 'BUILD', 3 => 'SEND', 4 => 'GENERAL')); $submit = new Element\Submit('submit'); $submit->setValue('Add News'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($title); $this->add($slug); $this->add($content); $this->add($category); $this->add($submit); }
public function getPerfil() { $element = new Select('perfil'); $element->setLabel('Perfil:'); $element->setAttributes(array('id' => 'perfil', 'class' => 'form-control validar')); return $element; }
public function setId($ids) { $this->data = $ids; $cata = new Element\Select('parent'); $cata->setLabel('Parent')->setAttribute('class', 'form-control select-dropdown')->setValueOptions($this->data); $this->add($cata); }
public function __construct(ServiceLocatorInterface $sm) { parent::__construct('formPost'); // definindo variáveis $em = $sm->get('Doctrine\\ORM\\EntityManager'); $arrCategorias = array("" => "Selecione"); $repoCategoria = $em->getRepository('Admin\\Entity\\Categoria'); $arrCategorias += $repoCategoria->fetchPairs(); $categoria = new Select('categoria'); $categoria->setLabel('Categoria')->setAttributes(array('id' => 'categoria', 'class' => 'form-control', 'options' => $arrCategorias)); $this->add($categoria); $nome = new Text('nome'); $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control', 'placeholder' => 'Digite o seu nome')); $this->add($nome); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'class' => 'form-control', 'style' => 'height: 80px', 'placeholder' => 'Digite a descrição do post')); $this->add($descricao); $conteudo = new Textarea('conteudo'); $conteudo->setLabel('Conteúdo')->setAttributes(array('id' => 'conteudo', 'class' => 'form-control', 'style' => 'min-height: 150px', 'placeholder' => 'Digite o conteúdo do post')); $this->add($conteudo); $tags = new Text('tags'); $tags->setLabel('Tags')->setAttributes(array('id' => 'tags', 'class' => 'form-control', 'placeholder' => 'Digite as tags do conteúdo')); $this->add($tags); $submit = new Submit('submit'); $submit->setValue('Salvar'); $this->add($submit); }
public function __construct($name = null) { parent::__construct('menus'); $this->setAttribute('class', 'form-horizontal'); $this->setAttribute('id', 'searchform'); $this->setAttribute('method', 'post'); $formValue = $this->formValue(); $name = new Element\Text('name'); $name->setLabel('Name')->setAttribute('class', 'required form-control')->setAttribute('id', 'name')->setAttribute('placeholder', 'Name'); $type = new Element\Select('type'); $type->setLabel('Type')->setAttribute('class', 'required form-control')->setValueOptions($formValue['type'])->setDisableInArrayValidator(true)->setAttribute('id', 'type')->setAttribute('placeholder', 'Type'); $resource_id = new Element\Select('resource_id'); $resource_id->setLabel('Resource')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'resource_id')->setAttribute('placeholder', 'Resource'); $url = new Element\Text('url'); $url->setLabel('Url')->setAttribute('class', 'required form-control')->setAttribute('id', 'url')->setAttribute('placeholder', 'Url'); $target = new Element\Select('target'); $target->setLabel('Target')->setAttribute('class', 'required form-control')->setValueOptions($formValue['target'])->setDisableInArrayValidator(true)->setAttribute('id', 'target')->setAttribute('placeholder', 'Target'); $parent_id = new Element\Select('parent_id'); $parent_id->setLabel('Parent')->setAttribute('class', 'required form-control')->setOptions(array())->setDisableInArrayValidator(true)->setAttribute('id', 'parent_id')->setAttribute('placeholder', 'Parent Id'); $status = new Element\Select('status'); $status->setLabel('Status')->setAttribute('class', 'required form-control')->setValueOptions($formValue['status'])->setDisableInArrayValidator(true)->setAttribute('id', 'status')->setAttribute('placeholder', 'Status'); $submit = new Element\Submit('submit'); $submit->setValue('Search')->setAttribute('class', 'btn btn-primary'); $this->add($name); $this->add($type); $this->add($resource_id); $this->add($url); $this->add($target); $this->add($parent_id); $this->add($status); $this->add($submit); }
public function __construct(ServiceLocatorInterface $sl) { parent::__construct('form-produto'); // instanciando o entity manager do doctrine $em = $sl->get('Doctrine\\ORM\\EntityManager'); // definindo variáveis $arrCategorias = array('' => 'Selecione'); $repoCategorias = $em->getRepository('Admin\\Entity\\Categoria'); $arrCategorias += $repoCategorias->getCategorias(); $categoria = new Select('categoria'); $categoria->setLabel('Categoria do produto')->setAttributes(array('id' => 'categoria', 'class' => 'form-control', 'style' => 'width: 700px', 'options' => $arrCategorias)); $this->add($categoria); $codigo = new Text('codigo'); $codigo->setLabel('Código do produto')->setAttributes(array('id' => 'codigo', 'style' => 'width: 200px', 'class' => 'form-control')); $this->add($codigo); $nome = new Text('nome'); $nome->setLabel('Nome do produto')->setAttributes(array('id' => 'nome', 'style' => 'width: 700px', 'class' => 'form-control')); $this->add($nome); $slug = new Text('slug'); $slug->setLabel('Slug do produto')->setAttributes(array('id' => 'slug', 'style' => 'width: 700px', 'class' => 'form-control')); $this->add($slug); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'style' => 'width: 700px; height: 100px', 'class' => 'form-control')); $this->add($descricao); $peso = new Text('peso'); $peso->setLabel('Peso')->setAttributes(array('id' => 'peso', 'style' => 'width: 150px', 'class' => 'form-control')); $this->add($peso); $ativo = new Checkbox('ativo'); $ativo->setLabel('Ativo')->setAttributes(array('id' => 'ativo', 'style' => 'width: 38px', 'class' => 'form-control')); $this->add($ativo); }
public function __construct(EntityManager $entityManager) { parent::__construct(); $this->entityManager = $entityManager; $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form")); $this->setInputFilter(new FaqPerguntasFilters()); // Campo de titulo $titulo = new Text('titulo'); $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "200", "class" => "form-control", "required" => "required")); // Campo de resposta $resposta = new Textarea('resposta'); $resposta->setLabel('* Resposta'); $resposta->setAttributes(array('class' => 'file form-control editor', 'cols' => '30', 'rows' => '10')); // Campo de titulo $tags = new Text('tags'); $tags->setLabel("* Tags")->setAttributes(array("maxLength" => "1000", "class" => "form-control count-character", "required" => "required")); // Campo categoria $categorias = new Select('id_categoria'); $categorias->setLabel("* Categoria")->setAttribute("class", "select")->setValueOptions($this->getCategorias()); // Botão de Submit $botao = new Submit("submit"); $botao->setAttributes(array("value" => "Salvar")); // Adiciona campos $this->add($titulo)->add($resposta)->add($tags)->add($categorias)->add($botao); }
public function __construct() { parent::__construct('page'); //Méthode d'envoie (GET,POST) $this->setAttribute('method', 'post'); //Définition des champs //Menu Page // $idField = new Element\Select('menu_id'); // $idField->setAttribute('class', 'browser-default'); // $idField->setLabel('Menu'); // $this->add($idField); $idField = new Element\Hidden('structure'); $idField->setAttribute('id', 'structureform'); $this->add($idField); $idField = new Element\Hidden('block_element'); $idField->setAttribute('id', 'block-element'); $this->add($idField); //Page Category $idField = new Element\Select('ctgr_id'); $idField->setAttribute('class', 'browser-default'); $idField->setLabel('Category'); $this->add($idField); //Page Title $titleField = new Element\Text('title'); $titleField->setLabel('Titre'); $this->add($titleField); //Page Content $contentField = new Element\Textarea('content'); $contentField->setLabel('Description'); $this->add($contentField); $submitField = new Element\Submit('submit'); $submitField->setValue('Envoyer'); $submitField->setAttributes(array('id' => 'submitbutton', 'class' => 'btn waves-effect waves-light btn-submit-form-page')); $this->add($submitField); }
public function __construct() { parent::__construct('personorg'); $this->setAttribute('method', 'post'); $this->add(new Element\Hidden('id_person')); $this->add(new Element\Hidden('id_organization')); $this->add(new Element\Hidden('bool_primary')); $this->add(new Element\Hidden('nid_lov_personorgtype')); $this->add(new Element\Hidden('dt_begin')); $name_title = new Element\Text('name_title'); $name_title->setLabel('Title')->setAttributes(array('class' => 'largewhite')); $this->add($name_title); $pnum_primary_order = new Element\Select('num_primary_order'); $pnum_primary_order->setLabel('Primary Order')->setAttributes(array('class' => 'tinywhite')); $this->add($pnum_primary_order); $dt_end = new Element\Date('dt_end'); $dt_end->setLabel('End Date')->setAttributes(array('class' => 'smallwhite', 'type' => 'date', 'id' => 'dt_end'))->setOptions(array('datepickerOptions' => array('changeYear: true', 'changeMonth: true', 'yearRange: "c-100:c+100"'))); $this->add($dt_end); $comment = new Element\Textarea('comment'); $comment->setLabel('Comment')->setAttributes(array('class' => 'smallwhite')); $this->add($comment); $back = new Element\Button('back'); $back->setLabel('Back')->setAttributes(array('id' => 'backbutton', 'class' => 'btn-success', 'style' => 'margin-right:70px;', 'onclick' => '')); $this->add($back); $submit = new Element\Submit('submit'); $submit->setValue('Login')->setAttributes(array('id' => 'submitbutton', 'class' => 'btn-success', 'style' => 'margin: 10px 0 10px 140px')); $this->add($submit); }
public function __construct() { parent::__construct('form-cupom'); $nome = new Text('nome'); $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control')); $this->add($nome); $codigo = new Text('codigo'); $codigo->setLabel('Código')->setAttributes(array('id' => 'codigo', 'class' => 'form-control')); $this->add($codigo); $descricao = new Textarea('descricao'); $descricao->setLabel('Descrição')->setAttributes(array('id' => 'descricao', 'class' => 'form-control')); $this->add($descricao); $tipo = new Select('tipo'); $tipo->setLabel('Tipo')->setAttributes(array('id' => 'tipo', 'class' => 'form-control', 'options' => array('1' => 'Cupom para o item', '2' => 'Cupom para o pedido'))); $this->add($tipo); $tipoDesconto = new Select('tipo_desconto'); $tipoDesconto->setLabel('Tipo Desconto')->setAttributes(array('id' => 'tipo_desconto', 'class' => 'form-control', 'options' => array('1' => 'Valor', '2' => 'Porcentagem'))); $this->add($tipoDesconto); $valor = new Text('valor'); $valor->setLabel('Valor')->setAttributes(array('id' => 'valor', 'class' => 'form-control')); $this->add($valor); $dtaIni = new Text('dta_ini'); $dtaIni->setLabel('Data Início')->setAttributes(array('id' => 'dta_ini', 'class' => 'form-control')); $this->add($dtaIni); $dtaFim = new Text('dta_fim'); $dtaFim->setLabel('Data Final')->setAttributes(array('id' => 'dta_fim', 'class' => 'form-control')); $this->add($dtaFim); }
public function __construct($name = null, array $comissoes = null) { parent::__construct($name); $this->comissoes = $comissoes; $this->setInputFilter(new MembroFilter()); $this->setAttribute('method', 'POST'); $id = new Hidden('id'); $this->add($id); $comissao = new Select(); $comissao->setLabel("Comissão ")->setName("comissao")->setOptions(array('value_options' => $this->comissoes)); $this->add($comissao); $membro = new Textarea('membro'); $membro->setLabel('Membros')->setAttribute('placeholder', 'Entre com os membros')->setAttribute('cols', '60')->setAttribute('rows', '5')->setAttribute('autofocus', 'autofocus'); $this->add($membro); $cargo = new Textarea('cargo'); $cargo->setLabel('Cargos')->setAttribute('placeholder', 'Entre com os cargos')->setAttribute('cols', '60')->setAttribute('rows', '5'); $this->add($cargo); $dataInicio = new Text('data_inicio'); $dataInicio->setLabel('Data Inicio'); $this->add($dataInicio); $dataFim = new Text('data_fim'); $dataFim->setLabel('Data Fim'); $this->add($dataFim); $button = new Button('submit'); $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success')); $this->add($button); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Thêm môn học'); $this->add($group); // name $name = new Text('name'); $name->setLabel('Tên môn học:'); $name->setAttributes(['maxlength' => 255]); $this->add($name); $group->addElement($name); $filter->add(array('name' => 'name', '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 tên môn học')))))); $categoryId = new Select('categoryId'); $categoryId->setLabel('Danh mục:'); $categoryId->setAttributes(['maxlength' => 10]); $this->add($categoryId); $this->loadCategories($categoryId, $options); $group->addElement($categoryId); $filter->add(array('name' => 'categoryId', 'required' => true, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập danh mục môn học')))))); // code $description = new Textarea('description'); $description->setLabel('Mô tả môn học:'); $description->setAttributes(['maxlength' => 255, 'class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $group->addElement($description); $filter->add(array('name' => 'description', 'required' => false, '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 mô tả môn học')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/subject/add'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/subject/add' => 'Tiếp tục nhập', '/admin/subject/index' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * Add role element */ public function addRoleElement($options = array(), $name = 'role') { $element = new Select($name); $element->setLabel('Benutzergruppe'); $element->setValueOptions($options); $this->add($element); }
public function buildForm() { $this->setAttribute('method', 'POST'); $category = new Select('category'); $category->setLabel('Category')->setValueOptions(array_combine($this->getCategories(), $this->getCategories())); $title = new Text('title'); $title->setLabel('Title')->setAttributes(array('size' => 50, 'maxLength' => 128, 'required' => 'required', 'placeholder' => 'Title', 'title' => 'Title')); $photo = new Text('photo_filename'); $photo->setLabel('Photo')->setAttribute('maxlength', 1024)->setAttribute('placeholder', 'Enter a valid image file URL'); $name = new Text('contact_name'); $name->setLabel('Contact Name')->setAttribute('title', 'Contact Name')->setAttribute('size', 50)->setAttribute('maxlength', 255); $email = new Email('contact_email'); $email->setLabel('Contact Email')->setAttribute('title', 'Contact Email')->setAttribute('size', 50)->setAttribute('maxlength', 255); $phone = new Text('contact_phone'); $phone->setLabel('Contact Phone Number')->setAttribute('title', 'Contact Phone Number')->setAttribute('size', 20)->setAttribute('maxlength', 32); $city = new Select('cityCode'); $city->setLabel('Nearest City')->setValueOptions(array_combine(self::$cityCodes, self::$cityCodes))->setAttribute('id', 'cityCode'); $price = new Text('price'); $price->setLabel('Price')->setAttribute('title', 'Price as nnn.nn')->setAttribute('size', 16)->setAttribute('maxlength', 16); $expires = new Radio('expires'); $expires->setLabel('Expires')->setAttribute('title', 'The expiration date from today')->setAttribute('class', 'expiresButton')->setValueOptions($this->getExpireDays()); $deleteCode = new Text('delete_code'); $deleteCode->setLabel('Delete Code')->setAttribute('title', 'Delete code for this item')->setAttribute('size', 16)->setAttribute('maxlength', 16); $description = new Textarea('description'); $description->setLabel('Description')->setAttribute('title', 'Description')->setAttribute('rows', 5)->setAttribute('cols', 80); $captchaAdapter = new ImageCaptcha(); $captchaAdapter->setWordlen(4)->setOptions($this->captchaOptions); $captcha = new Captcha('captcha'); $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help us to prevent SPAM'); $submit = new Submit('submit'); $submit->setAttribute('value', 'Post'); $this->add($category)->add($title)->add($photo)->add($name)->add($email)->add($phone)->add($city)->add($price)->add($expires)->add($deleteCode)->add($description)->add($captcha)->add($submit); }