當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Submit::setName方法代碼示例

本文整理匯總了PHP中Zend\Form\Element\Submit::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Submit::setName方法的具體用法?PHP Submit::setName怎麽用?PHP Submit::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Form\Element\Submit的用法示例。


在下文中一共展示了Submit::setName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 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');
         }
     }
 }
開發者ID:JonathanConner,項目名稱:SocialNet,代碼行數:25,代碼來源:RegisterForm.php

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

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('action', '/user/dashboard/post/create');
     $this->setAttribute('id', 'user-post-form');
     $title = new Text();
     $title->setName('title')->setLabel('Title')->setAttribute('required', 'true');
     $body = new Textarea();
     $body->setName('body')->setAttributes(array('placeholder' => 'Your post content...', 'rows' => 8, 'resizable' => 'false', 'required' => 'true'));
     $csrf = new Csrf();
     $csrf->setName('prev');
     $submit = new Submit();
     $submit->setName('submit')->setValue('Create')->setAttribute('class', 'btn btn-info');
     $this->add($title)->add($body)->add($csrf)->add($submit);
     foreach ($this->elements as $element) {
         if (!$element instanceof Submit) {
             $element->setAttribute('class', 'form-control');
         }
     }
 }
開發者ID:JonathanConner,項目名稱:SocialNet,代碼行數:21,代碼來源:PostForm.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('action', '/user/dashboard/messages/create');
     $this->setAttribute('class', 'form-horizontal');
     $this->setAttribute('id', 'user-message-form');
     $to = new Text();
     $to->setName('recipient')->setLabel('Recipients')->setAttribute('id', 'recipients');
     $subject = new Text();
     $subject->setName('subject')->setLabel('Subject');
     $body = new Textarea();
     $body->setName('body')->setAttributes(array('placeholder' => 'Your message...', 'rows' => 4));
     $csrf = new Csrf();
     $csrf->setName('prev');
     $submit = new Submit();
     $submit->setName('submit')->setValue('Send');
     $this->add($to)->add($subject)->add($body)->add($csrf)->add($submit);
     foreach ($this->elements as $element) {
         if (!$element instanceof Submit) {
             $element->setAttribute('class', 'form-control');
         }
     }
 }
開發者ID:JonathanConner,項目名稱:SocialNet,代碼行數:24,代碼來源:MessageForm.php

示例5: __construct

 public function __construct($name = null)
 {
     parent::__construct('create-cliente');
     //nome
     $nome = new Text();
     $nome->setName("name");
     $nome->setAttribute('placeholder', 'Nome');
     $nome->setAttribute('class', 'form-control');
     $this->add($nome);
     //cognome
     $cognome = new Text();
     $cognome->setName("cognome");
     $cognome->setAttribute('placeholder', 'Cognome');
     $cognome->setAttribute('class', 'form-control');
     $this->add($cognome);
     //email
     $email = new Text();
     $email->setName("email");
     $email->setAttribute('placeholder', 'email');
     $email->setAttribute('class', 'form-control');
     $this->add($email);
     // numero di telefono
     $num = new Text();
     $num->setName("num");
     $num->setAttribute('placeholder', 'Numero di telefono');
     $num->setAttribute('class', 'form-control');
     $this->add($num);
     //bottone
     $btn = new Submit();
     $btn->setName("submit");
     $btn->setAttribute('value', 'go');
     $btn->setAttribute('id', 'submitbutton');
     $btn->setAttribute('class', 'btn btn-primary');
     $this->add($btn);
     $this->setInputFilter($this->createInputFilter());
 }
開發者ID:dany9920,項目名稱:gestionale,代碼行數:36,代碼來源:ClienteCreationForm.php


注:本文中的Zend\Form\Element\Submit::setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。