コード例 #1
0
ファイル: SearchForm.php プロジェクト: lohmuller/OnlineMarket
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public function __construct($name = 'mailchimp-sub-form', $options = array())
 {
     parent::__construct($name, $options);
     $firstName = new Element\Text('firstName');
     $firstName->setLabel('First Name');
     $lastName = new Element\Text('lastName');
     $lastName->setLabel('Last Name');
     $email = new Element\Email('email');
     $email->setLabel('Email Address');
     $emailValidator = new Validator\EmailAddress(array('allow' => Validator\Hostname::ALLOW_DNS, 'domain' => true));
     $email->setValidator($emailValidator);
     $privacyPolicy = new Element\Checkbox('privacyPolicy');
     $privacyPolicy->setLabel('I accept the privacy policy and the terms of use');
     $csrf = new Element\Csrf('mcSubCSRF');
     $submit = new Element\Submit('submit');
     $submit->setValue('Subscribe');
     $this->add($firstName);
     $this->add($lastName);
     $this->add($email);
     $this->add($privacyPolicy);
     $this->add($csrf);
     $this->add($submit);
     $inputFilter = $this->getInputFilter();
     $inputFilter->get($firstName->getName())->setAllowEmpty(false)->setRequired(true);
     $inputFilter->get($lastName->getName())->setAllowEmpty(false)->setRequired(true);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: NewsForm.php プロジェクト: gstearmit/EshopVegeTable
 public function __construct($name = null)
 {
     parent::__construct('news-form');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     //         $this->add(array(
     //             'name' => 'news_name',
     //             'attributes' => array(
     //                 'type' => 'text',
     //                 'maxlength' => 250,
     //                 'class' => 'form-control',
     //                 //'required' => 'true',
     //             	'onchange','get_static()',
     //             ),
     //             'options' => array(
     //                 'label' => 'Title',
     //             ),
     //         ));
     $news_name = new Element\Text('news_name');
     $news_name->setLabel('Title:')->setAttribute('class', 'Title')->setAttribute('id', 'news_name')->setAttribute('type', 'text')->setAttribute('maxlength', 250)->setAttribute('class', 'form-control')->setAttribute('onchange', 'get_static();')->setAttribute('type', 'text');
     $this->add($news_name);
     $this->add(array('name' => 'url_static', 'attributes' => array('type' => 'text', 'id' => 'url_static', 'maxlength' => 250, 'class' => 'form-control'), 'options' => array('label' => 'Static-url')));
     $this->add(array('name' => 'news_thumbnail', 'attributes' => array('type' => 'file', 'class' => '', 'accept' => '.jpg, .png, .gif, .jpeg, .JPG, .PNG, .GIF, .JPEG'), 'options' => array('label' => 'Thumbnail')));
     $this->add(array('name' => 'news_content', 'type' => 'Zend\\Form\\Element\\Textarea', 'attributes' => array('class' => 'form-control', 'rows' => 5), 'options' => array('label' => 'Content')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'security', 'options' => array('csrf_options' => array('timeout' => 600))));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Save changes', 'class' => 'btn btn-primary')));
 }
コード例 #6
0
ファイル: ViewScriptTest.php プロジェクト: alab1001101/zf2
 public function getElement()
 {
     $element = new TextElement('foo');
     $element->setView($this->getView());
     $this->decorator->setElement($element);
     return $element;
 }
コード例 #7
0
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'POST');
     $Controller = new Text('Controller');
     $Controller->setLabel("Controller: ");
     $Controller->setAttributes(array("class" => 'form-control'));
     $this->add($Controller);
     $nome = new Text('nome');
     $nome->setLabel("Nome: ");
     $nome->setAttributes(array("class" => 'form-control'));
     $this->add($nome);
     $label = new Text('label');
     $label->setLabel("Label: ");
     $label->setAttributes(array("class" => 'form-control'));
     $this->add($label);
     $route = new Text('route');
     $route->setLabel("Route: ");
     $route->setAttributes(array("class" => 'form-control'));
     $this->add($route);
     $select = new \Zend\Form\Element\Select('parentView');
     $select->setLabel('Parente View');
     $select->setAttributes(array("class" => 'form-control'));
     $select->setValueOptions(array('0' => 'French', '1' => 'English', '2' => 'Japanese', '3' => 'Chinese'));
     $this->add($select);
     $status = new \Zend\Form\Element\Select('Status');
     $status->setLabel('Status');
     $status->setAttributes(array("class" => 'form-control'));
     $status->setValueOptions(array('0' => '', '1' => 'Ativo', '2' => 'Inativo'));
     $this->add($status);
     $submit = new \Zend\Form\Element\Submit('Salvar');
     $submit->setValue('Salvar')->setAttributes(array("class" => 'btn btn-primary btn-lg btn-block'));
     $this->add($submit);
 }
コード例 #8
0
ファイル: Category.php プロジェクト: NguyenQuiDuong/Funix
 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 danh mục môn học');
     $this->add($group);
     // name
     $name = new Text('name');
     $name->setLabel('Tên danh mụ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 danh mục'))))));
     // code
     $description = new Textarea('description');
     $description->setLabel('Mô tả danh mụ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ả danh mục'))))));
     $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/subject/addcategory'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/subject/addcategory' => 'Tiếp tục nhập', '/admin/subject/category' => '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')));
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 public function getForm(array $defaultStatus)
 {
     if (!$this->form) {
         $currencyId = new Element\Hidden();
         $currencyId->setName('currencyId');
         $name = new Element\Text();
         $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control');
         $code = new Element\Text();
         $code->setLabel('Code')->setName("code")->setAttribute('class', 'form-control');
         $rate = new Element\Text();
         $rate->setLabel('Rate')->setName("rate")->setAttributes(array('class' => 'form-control'));
         $status = new Element\Select();
         $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus);
         $changedRate = new Element\Checkbox();
         $changedRate->setName('changedRate')->setLabel('Auto renew?')->setAttribute('class', 'form-control');
         $form = new Form();
         $form->setAttribute('class', 'form-horizontal');
         $form->add($currencyId);
         $form->add($code);
         $form->add($name);
         $form->add($rate);
         $form->add($status);
         $form->add($changedRate);
         $this->form = $form;
     }
     return $this->form;
 }
コード例 #11
0
ファイル: OrgtypeForm.php プロジェクト: shiqizhang/php-sample
 public function __construct()
 {
     // we want to ignore the name passed
     parent::__construct('orgtype');
     $this->setAttribute('method', 'post');
     $type_organization = new Element\Text('type_organization');
     $type_organization->setLabel('Organization Type')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($type_organization);
     $genre = new Element\Text('genre');
     $genre->setLabel('Genre')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($genre);
     $bool_unioned = new Element\Radio('bool_unioned');
     $bool_unioned->setLabel('Unioned ?')->setLabelAttributes(array('class' => 'radio-inline'))->setValueOptions(array('1' => 'Yes', '0' => 'No'));
     $this->add($bool_unioned);
     $registered_location = new Element\Text('registered_location');
     $registered_location->setLabel('Registered Location')->setAttributes(array('class' => 'form-control input-sm'));
     $this->add($registered_location);
     $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);
 }
コード例 #12
0
 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')));
 }
コード例 #13
0
ファイル: Add.php プロジェクト: samija/Deeplifec4tk
 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);
 }
コード例 #14
0
 public function getForm(array $default_status)
 {
     if (!$this->form) {
         $hidId = new Element\Hidden();
         $hidId->setName('userId');
         $txtName = new Element\Text();
         $txtName->setLabel('User Name')->setName("userName")->setAttribute('class', 'form-control');
         $password = new Element\Password();
         $password->setLabel('Password')->setName('password')->setAttribute('class', 'form-control');
         $confirmPassword = new Element\Password();
         $confirmPassword->setName('confirmPassword')->setLabel('Retype Password')->setAttribute('class', 'form-control');
         $selectRole = new Element\Hidden('userRole');
         $description = new Element\Textarea();
         $description->setName('description')->setLabel('Description')->setAttribute('class', 'form-control');
         $status = new Element\Select();
         $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($default_status);
         $image = new Element\File();
         $image->setName('image')->setLabel('Profile image');
         $form = new Form();
         $form->setAttribute('class', 'form-horizontal');
         $form->setAttribute('enctype', 'multipart/form-data');
         $form->add($hidId);
         $form->add($txtName);
         $form->add($password);
         $form->add($confirmPassword);
         $form->add($selectRole);
         $form->add($description);
         $form->add($status);
         $form->add($image);
         $this->form = $form;
     }
     return $this->form;
 }
コード例 #15
0
 public function __construct()
 {
     parent::__construct('form-pagamentostatus');
     $nome = new Text('nome');
     $nome->setLabel('Nome')->setAttributes(array('id' => 'nome', 'class' => 'form-control'));
     $this->add($nome);
 }
コード例 #16
0
 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);
 }
コード例 #17
0
 public function __construct(EntityManager $entityManager)
 {
     parent::__construct();
     $this->entityManager = $entityManager;
     $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form"));
     $this->setInputFilter(new HomeBannersFilters());
     // Campo de titulo
     $titulo = new Text('titulo');
     $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "400", "class" => "form-control", "required" => "required"));
     // Campo tipo de midia
     $tipo = new Radio('tipo_banner');
     $tipo->setLabel('Tipo de mídia');
     $tipo->setValueOptions(array('IMAGEM' => 'Imagem', 'VIDEO' => 'Vídeo'))->setOptions(array('label_attributes' => array('class' => 'radio-inline')))->setAttribute("value", "IMAGEM");
     // Campo de midia
     $file = new File("midia");
     $file->setLabel('*Imagem (Tamanho exato de ' . \Base\Constant\Upload::BANNER_WIDTH . 'x' . \Base\Constant\Upload::BANNER_HEIGTH . ' px | ' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('name', 'midia')->setAttribute('id', 'image');
     // Campo de midia2
     $file2 = new File("midia2");
     $file2->setLabel('*Video (' . \Base\Constant\Upload::BANNER_MAX_SIZE . ')')->setAttribute('id', 'video');
     // Botão de Submit
     $botao = new Submit("submit");
     $botao->setAttributes(array("value" => "Salvar"));
     // Adiciona campos
     $this->add($titulo)->add($tipo)->add($file)->add($file2)->add($botao);
 }
コード例 #18
0
 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);
 }
コード例 #19
0
 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);
 }
コード例 #20
0
ファイル: FormText.php プロジェクト: trongle/book_zend2
 public function __invoke($name, $value, array $attributes = null)
 {
     $attributes = $this->setDefaultAttributes($attributes);
     $element = new Text($name);
     $element->setValue($value)->setAttributes($attributes);
     return $this->render($element);
 }
コード例 #21
0
ファイル: Signin.php プロジェクト: projectHN/mentor
 /**
  * @param null|string $name
  */
 public function __construct($serviceLocator, $options = null)
 {
     parent::__construct('signin');
     $this->setServiceLocator($serviceLocator);
     $this->setAttribute('method', 'post');
     $this->setOptions(['layout' => 'fluid']);
     $filter = $this->getInputFilter();
     //$groupBasic = new DisplayGroup('groupBasic');
     //$this->add($groupBasic);
     $csrf = new Csrf('csrf');
     $this->add($csrf);
     $filter->add(array('name' => 'csrf', 'required' => false, 'filters' => array(array('name' => 'StringTrim'))));
     $mail = new Text('mail');
     $mail->setLabel('Email:');
     $mail->setAttributes(array('type' => 'text', 'id' => 'mail'));
     $this->add($mail);
     //$groupBasic->addElement($username);
     $filter->add(array('name' => 'mail', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email đăng nhập'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ'))))));
     $password = new Password('password');
     $password->setAttributes(array('type' => 'password', 'id' => 'password'));
     $password->setLabel('Mật khẩu:');
     $this->add($password);
     //$groupBasic->addElement($password);
     $filter->add(array('name' => 'password', 'required' => true, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu'))))));
     $config = $this->getServiceLocator()->get('Config');
     $this->captcha = new ReCaptcha(array('pubkey' => $config['captcha']['reCAPTCHA']['publicKey'], 'privkey' => $config['captcha']['reCAPTCHA']['privateKey'], 'ssl' => !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? false : true));
     $captcha = new Captcha('captcha');
     $captcha->setLabel('Mã bảo mật:');
     $captcha->setCaptcha($this->captcha);
     $this->add($captcha);
     //$groupBasic->addElement($captcha);
     $filter->add(array('name' => 'captcha', '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 captcha'))), $this->captcha)));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Đăng nhập', 'id' => 'btnSignin', 'class' => 'btn btn-primary col-md-12')));
     //$groupBasic->addElement($this->get('submit'));
 }
コード例 #22
0
 public function getLogin()
 {
     $element = new Text('login');
     $element->setLabel('Login');
     $element->setAttributes(array('id' => 'login', 'class' => 'form-control', 'placeholder' => 'Digite o seu login'));
     return $element;
 }
コード例 #23
0
 /**
  * @return UserFiedlset
  */
 public function addName()
 {
     $elementTextSurName = new Element\Text('name');
     $elementTextSurName->setLabel('Name');
     $this->add($elementTextSurName);
     return $this;
 }
コード例 #24
0
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post')->setAttribute('action', '/user/register')->setAttribute('id', 'user-register-form');
     $email = new Email();
     $email->setName('email')->setLabel('Email Address');
     $userName = new Text();
     $userName->setName('userName')->setLabel('Username');
     $password = new Password();
     $password->setName('password')->setLabel('Password');
     $firstName = new Text();
     $firstName->setName('firstName')->setLabel('First Name');
     $lastName = new Text();
     $lastName->setName('lastName')->setLabel('Last Name');
     $csrf = new Csrf();
     $csrf->setName('prev');
     $submit = new Submit();
     $submit->setName('submit')->setValue('Register');
     $this->add($email)->add($userName)->add($password)->add($firstName)->add($lastName)->add($csrf)->add($submit);
     foreach ($this->elements as $element) {
         if (!$element instanceof Submit) {
             $element->setAttribute('class', 'form-control');
         }
     }
 }
コード例 #25
0
ファイル: MembroForm.php プロジェクト: souzagabi/Agenda
 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);
 }
コード例 #26
0
ファイル: FilhoForm.php プロジェクト: souzagabi/Agenda
 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);
 }
コード例 #27
0
 public function __construct(ObjectManager $objectManager)
 {
     $this->setObjectManager($objectManager);
     parent::__construct(null);
     $this->setAttributes(array('method' => 'POST', 'accept-charset' => 'UTF-8', 'class' => 'form-horizontal'));
     //input Titulo
     $titulo = new Text('titulo');
     $titulo->setLabel('Titulo')->setAttributes(array('id' => 'nome', 'maxlength' => 80, 'class' => 'form-control'));
     $this->add($titulo);
     //input descri��o
     $descricao = new Textarea('descricao');
     $descricao->setLabel("Descricao")->setAttributes(array('id' => 'descricao', 'maxlength' => 150, 'class' => 'form-control'));
     $this->add($descricao);
     //input texto
     $texto = new Textarea('texto');
     $texto->setLabel('Texto')->setAttributes(array('id' => 'texto', 'class' => 'form-control'));
     $this->add($texto);
     //input Ativo
     $ativo = new Checkbox('ativo');
     $ativo->setLabel('Ativo')->setLabelAttributes(array('class' => 'checkbox-inline'))->setOptions(array('use_hidden_element' => true));
     $this->add($ativo);
     //Categoria
     $categoria = new ObjectSelect('category');
     $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Categoria\\Entity\\Category', 'property' => 'nome', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('nome' => 'ASC')))))->setAttributes(array('id' => 'category', 'class' => 'form-control'));
     $this->add($categoria);
     //botao submit
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-default'));
     $this->add($button);
     $this->setInputFilter(new PostFilter($categoria->getValueOptions()));
 }
コード例 #28
0
ファイル: BookForm.php プロジェクト: billjordan/zend-app
 public function __construct($name = null)
 {
     parent::__construct('book');
     $this->add(array('name' => 'id', 'type' => 'Hidden'));
     $this->add(array('name' => 'title', 'type' => 'text', 'options' => array('label' => 'Title')));
     /*
            $this->add(array(
                'name' => 'author',
                'type' => 'text',
                'options' => array(
                    'label' => 'author',
                ),
            ));
     */
     $authorTextInput = new Element\Text($name = 'author');
     $authorTextInput->setLabel('author');
     $this->add($authorTextInput);
     /*
             $this->add(array(
                 'name' => 'submit',
                 'type' => 'submit',
                 'attributes' => array(
                     'value' => 'Go',
                     'id' => 'submitbutton',
                 ),
             ));        
     */
     $submitButton = new Element\Submit($name = 'submit');
     $submitButton->setAttribute('value', 'Go');
     $submitButton->setAttribute('id', 'submitButton');
     $this->add($submitButton);
 }
コード例 #29
0
ファイル: UserForm.php プロジェクト: andreaszobl/software
 /**
  * Add lastname element
  */
 public function addLastnameElement($name = 'lastname')
 {
     $element = new Text($name);
     $element->setLabel('Nachname');
     $element->setAttribute('class', 'form-control input-small');
     $this->add($element);
 }
コード例 #30
0
 /**
  * GeradorForm constructor.
  */
 public function __construct()
 {
     parent::__construct(null);
     $this->setAttribute('method', 'POST');
     $this->setInputFilter(new CriarControllerFilter());
     //Input strForm
     $strForm = new Text('strForm');
     $strForm->setLabel('strForm')->setAttributes(array('maxlength' => 100));
     $this->add($strForm);
     //Input strController
     $strController = new Text('strController');
     $strController->setLabel('strController')->setAttributes(array('maxlength' => 100));
     $this->add($strController);
     //Input strRoute
     $strRoute = new Text('strRoute');
     $strRoute->setLabel('strRoute')->setAttributes(array('maxlength' => 100));
     $this->add($strRoute);
     //Input strService
     $strService = new Text('strService');
     $strService->setLabel('strService')->setAttributes(array('maxlength' => 100));
     $this->add($strService);
     //Input strEntity
     $strEntity = new Text('strEntity');
     $strEntity->setLabel('strEntity')->setAttributes(array('maxlength' => 100));
     $this->add($strEntity);
     //Botao submit
     $button = new Button('submit');
     $button->setLabel('Salvar')->setAttributes(array('type' => 'submit', 'class' => 'btn'));
     $this->add($button);
 }