本文整理汇总了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');
}
}
}
示例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');
}
}
}
}
示例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');
}
}
}
示例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');
}
}
}
示例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());
}