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


PHP Element\Submit类代码示例

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


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

示例1: __construct

 public function __construct($name = null)
 {
     parent::__construct('users');
     $this->setAttribute('class', 'form-horizontal');
     $this->setAttribute('method', 'post');
     $this->setAttribute('id', 'changePasswordForm');
     $this->setAttribute('novalidate', true);
     $this->setAttribute('autocomplete', false);
     $id = new Element\Hidden('id');
     $id->setAttribute('class', 'primarykey');
     $id->setAttribute('id', 'id');
     $cpassword = new Element\Password('cpassword');
     $cpassword->setLabel('Current Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'cpassword')->setAttribute('placeholder', 'Current Password');
     $password = new Element\Password('password');
     $password->setLabel('New Password')->setAttribute('class', 'required form-control password_strength_check')->setAttribute('id', 'password')->setAttribute('placeholder', 'New Password');
     $repassword = new Element\Password('repassword');
     $repassword->setLabel('Re-type Password')->setAttribute('class', 'required form-control')->setAttribute('id', 'repassword')->setAttribute('placeholder', 'Re-type Password');
     $submit = new Element\Submit('submit');
     $submit->setValue('Change Password')->setAttribute('id', 'submit')->setAttribute('class', 'btn btn-lg btn-success btn-block');
     $this->add($id);
     $this->add($cpassword);
     $this->add($password);
     $this->add($repassword);
     //        $this->add($submit);
 }
开发者ID:tahmina8765,项目名称:zf2auth,代码行数:25,代码来源:ChangePasswordForm.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($name = 'workflowform')
 {
     //         $this->setDbAdapter($dbAdapter);
     // we want to ignore the name passed
     parent::__construct($name);
     $dbAdapter = GlobalAdapterFeature::getStaticAdapter();
     if ($dbAdapter != null) {
         $this->setDbAdapter($dbAdapter);
     } else {
         throw new \Exception('no dbAdapter loaded');
     }
     //         $workflowElement = new Collection('workflow');
     //         $workflowElement->setOptions(array(
     //             'label' => 'Workflow',
     //             'target_element' => array(
     //                 'type' => 'CookingAssist\Form\WorkflowFieldset')
     //         ));
     //         $this->add($workflowElement);
     $this->add(array('name' => 'Id', 'type' => 'Hidden'));
     $this->add(array('name' => 'Title', 'type' => 'Text', 'options' => array('label' => 'Titel')));
     $this->add(array('name' => 'Tipp', 'type' => 'Text', 'options' => array('label' => 'Tipp')));
     $submitElement = new Submit('Submit');
     $submitElement->setValue('Hinzufügen');
     $this->add($submitElement);
 }
开发者ID:bbuehler99,项目名称:cookingassist,代码行数:25,代码来源:AddWorkflowForm.php

示例4: __construct

 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);
 }
开发者ID:billjordan,项目名称:zend-app,代码行数:32,代码来源:BookForm.php

示例5: indexAction

 /**
  * The default action - show the home page
  */
 public function indexAction()
 {
     // init vars
     $data = NULL;
     $table = $this->getServiceLocator()->get('city-codes-table');
     $catList = $this->getServiceLocator()->get('form-demo-categories');
     $cityList = $table->getAllCityCodesForForm();
     $countryList = $table->getAllCountryCodesForForm();
     // submit button
     $submit = new Submit('submit');
     $submit->setAttribute('value', 'Submit');
     // build form
     $builder = new AnnotationBuilder();
     $entity = $this->getServiceLocator()->get('form-demo-listings-entity');
     $form = $builder->createForm($entity);
     $form->get('category')->setValueOptions(array_combine($catList, $catList));
     $form->getInputFilter()->get('category')->getValidatorChain()->attachByName('InArray', array('haystack' => $catList));
     $form->get('country')->setValueOptions($countryList);
     $form->getInputFilter()->get('country')->getValidatorChain()->attachByName('InArray', array('haystack' => $countryList));
     $form->add($submit);
     $form->bind($entity);
     if ($this->getRequest()->isPost()) {
         $form->setData($this->params()->fromPost());
         if ($form->isValid()) {
             $data = $form->getData();
         }
     }
     return new ViewModel(array('form' => $form, 'data' => $data, 'cityList' => $cityList));
 }
开发者ID:jordiwes,项目名称:zf2.unlikelysource.org,代码行数:32,代码来源:AnnotationController.php

示例6: __construct

 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);
 }
开发者ID:tahmina8765,项目名称:zf2menu,代码行数:32,代码来源:MenusSearchForm.php

示例7: getSubmit

 protected function getSubmit()
 {
     $element = new Submit('logar');
     $element->setValue('Logar');
     $element->setAttributes(array('class' => 'btn btn-primary'));
     return $element;
 }
开发者ID:ericoautocad,项目名称:module-security-zf2,代码行数:7,代码来源:Login.php

示例8: __construct

 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);
 }
开发者ID:RodrigoAngeloValentini,项目名称:curso-zf2,代码行数:27,代码来源:Post.php

示例9: __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

示例10: __construct

 public function __construct($name = null, $options = array())
 {
     //Formulario
     //Contruimos el formulario en base al padre
     parent::__construct('login', $options);
     //seteamos el actiond el formulario
     $this->setAttributes(array('action' => '/application/index/login'));
     //Elementos
     //Creamos un elemento de tipo texto y seteamos su atributo name
     $e = new Element\Text('name');
     //Seteamos los atributos del elemento
     $e->setAttributes(array('id' => 'txt_name', 'class' => 'txt_name_clase'));
     //seteamos las opciones del elemento
     $e->setOptions(array('label' => 'Usuario: '));
     //añadimos al formulario
     $this->add($e);
     //Definimos los parametros del elemento a generar
     $e = array('type' => 'password', 'name' => 'password', 'attributes' => array('id' => `txt_password`, 'class' => 'txt_password_clase'), 'options' => array('label' => 'Clave: '));
     //agregamo el elemento
     $this->add($e);
     //Agregando un boton
     $e = new Element\Submit('enviar');
     $e->setAttributes(array('id' => `btn_login`, 'value' => 'Enviar', 'class' => 'btn_login'));
     $this->add($e);
 }
开发者ID:ederunt,项目名称:practica,代码行数:25,代码来源:demoForm.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('action', '/user/login');
     $this->setAttribute('class', 'form');
     $this->setAttribute('id', 'userLoginForm');
     $this->setAttribute('role', 'form');
     $email = new Email();
     $email->setName('email')->setLabel('Email Address')->setAttribute('required', 'true');
     $password = new Password();
     $password->setName('password')->setLabel('Password')->setAttribute('required', 'true');
     $csrf = new Csrf();
     $csrf->setName('prev');
     $checkbox = new Checkbox();
     $checkbox->setName('remember-me');
     $checkbox->setOptions(['use_hidden_element' => false, 'required' => false]);
     $checkbox->setChecked("checked");
     $submit = new Submit();
     $submit->setName('submit')->setValue('Sign In');
     $this->add($email)->add($password)->add($checkbox)->add($csrf)->add($submit);
     foreach ($this->elements as $element) {
         if ($element instanceof Checkbox) {
             $element->setAttributes(['class' => 'custom-checkbox', 'data-toggle' => 'checkbox']);
         } else {
             if ($element instanceof Submit) {
                 $element->setAttributes(['class' => 'btn-inverse btn-large', 'id' => 'loginSubmit']);
             } else {
                 $element->setAttribute('class', 'form-control');
             }
         }
     }
 }
开发者ID:JonathanConner,项目名称:SocialNet,代码行数:33,代码来源:LoginForm.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(' ');
     $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: addElements

 public function addElements()
 {
     //-- Profile name --
     $login = new Element\Text('profile_name');
     $login->setAttribute('placeholder', 'profile_name');
     $login->setAttribute('required', 'true');
     $login->setAttribute('class', 'form-control');
     $login->setAttribute('id', 'profile-name');
     $login->setLabel('Profile name');
     $login->setLabelAttributes(array('class' => 'control-label', 'for' => 'profile-name'));
     //-- Password --
     $password = new Element\Password('password');
     $password->setAttribute('placeholder', '*****');
     $password->setAttribute('required', 'true');
     $password->setAttribute('class', 'form-control');
     $password->setAttribute('id', 'password');
     $password->setLabel('Password');
     $password->setLabelAttributes(array('class' => 'control-label', 'for' => 'password'));
     //-- Submit --
     $submit = new Element\Submit('submit');
     $submit->setAttribute('class', 'btn btn-success');
     $submit->setValue('Send');
     // Binding elements
     $this->add($login);
     $this->add($password);
     $this->add($submit);
 }
开发者ID:anton-phpcurs,项目名称:aperture,代码行数:27,代码来源:LoginForm.php

示例15: prepareElements

 public function prepareElements($topicList, $categoryList, $captchaOptions)
 {
     // repurpose $topicList and $categoryList
     $topics = array('---' => 'Choose');
     foreach ($topicList as $item) {
         $topics[$item->item] = $item->item;
     }
     $categories = array('---' => 'Choose');
     foreach ($categoryList as $item) {
         $categories[$item->item] = $item->item;
     }
     $author = new Element\Hidden('author');
     $category1 = new Element\Text('category');
     $category1->setLabel('Category')->setAttribute('title', 'Enter a category: i.e. zf2 or use the dropdown list below')->setAttribute('size', 16)->setAttribute('maxlength', 16);
     $category2 = new Element\Select('selectCategory');
     $category2->setValueOptions($categories);
     $topic1 = new Element\Text('topic');
     $topic1->setLabel('Topic')->setAttribute('title', 'Enter a topic code: i.e. zf2f-2013-02-25 or use the dropdown list below')->setAttribute('size', 60)->setAttribute('maxlength', 254);
     $topic2 = new Element\Select('selectTopic');
     $topic2->setValueOptions($topics);
     $title = new Element\Text('title');
     $title->setLabel('Title')->setAttribute('title', 'Enter a suitable title for this posting')->setAttribute('size', 60)->setAttribute('maxlength', 254);
     $body = new Element\Textarea('body');
     $body->setLabel('Body')->setAttribute('title', 'Enter the body for this posting')->setAttribute('rows', 4)->setAttribute('cols', 60);
     $captcha = new Element\Captcha('captcha');
     $captchaAdapter = new Captcha\Image();
     $captchaAdapter->setWordlen(4)->setOptions($captchaOptions);
     $captcha->setCaptcha($captchaAdapter)->setLabel('Help us to prevent SPAM!')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Help to prevent SPAM');
     $submit = new Element\Submit('submit');
     $submit->setAttribute('value', 'Post')->setAttribute('title', 'Click here when done');
     $this->add($author)->add($topic1)->add($topic2)->add($category1)->add($category2)->add($title)->add($body)->add($captcha)->add($submit);
 }
开发者ID:jordiwes,项目名称:zf2.unlikelysource.org,代码行数:32,代码来源:ForumForm.php


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