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


PHP Submit::setAttributes方法代码示例

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


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

示例1: addSubmit

 public function addSubmit($label)
 {
     $submitButton = new Submit('form-submit');
     $submitButton->setValue($label);
     $submitButton->setAttributes(['type' => 'submit', 'class' => 'btn btn-default']);
     $this->add($submitButton);
 }
开发者ID:netsensia,项目名称:zf2-foundation,代码行数:7,代码来源:NetsensiaForm.php

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

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setAttributes(array('class' => 'form'));
     // Current Password
     $current = new Element\Password('current_password');
     $current->setLabel('Current Password');
     $current->setAttributes(array('class' => 'form-control input-sm', 'id' => 'current-password-field'));
     $this->add($current);
     // New Password
     $new = new Element\Password('new_password');
     $new->setLabel('New Password');
     $new->setAttributes(array('class' => 'form-control input-sm', 'id' => 'new-password-field'));
     $this->add($new);
     // Confirm Password
     $confirm = new Element\Password('confirm_password');
     $confirm->setLabel('Confirm Password');
     $confirm->setAttributes(array('class' => 'form-control input-sm', 'id' => 'confirm-password-field'));
     $this->add($confirm);
     // Submit button.
     $submit = new Element\Submit('submit');
     $submit->setValue('O.K.');
     $submit->setAttributes(array('id' => 'submit', 'class' => 'btn btn-sm btn-primary'));
     $this->add($submit);
 }
开发者ID:srayner,项目名称:civuser,代码行数:25,代码来源:ChangepasswordForm.php

示例4: __construct

 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);
 }
开发者ID:kayo-almeida,项目名称:cms-zend,代码行数:25,代码来源:FaqPerguntasForm.php

示例5: __construct

 public function __construct(EntityManager $objectManager)
 {
     parent::__construct('ligue');
     $this->setAttributes(array('method' => 'post', 'id' => 'auth', 'role' => 'form'));
     $this->setInputFilter(new LigueFilter($objectManager));
     $this->setHydrator(new DoctrineObject($objectManager));
     // Id
     $id = new Hidden('id');
     $this->add($id);
     // Nom
     $nom = new Text('nom');
     $nom->setLabel('Nom')->setLabelAttributes(array('class', 'control-label'));
     $nom->setAttributes(array('id' => 'nom', 'class' => 'form-control', 'placeholder' => 'Nom', 'required' => true));
     $this->add($nom);
     // Image
     $image = new File('image');
     $image->setLabel('Image')->setLabelAttributes(array('class', 'control-label'));
     $image->setAttributes(array('id' => 'image', 'class' => 'form-control', 'placeholder' => 'Image'));
     $this->add($image);
     // Date début
     $dateDebut = new Text('dateDebut');
     $dateDebut->setLabel('Début de la ligue')->setLabelAttributes(array('class', 'control-label'));
     $dateDebut->setAttributes(array('id' => 'dateDebut', 'class' => 'form-control'));
     //$this->add($dateDebut);
     // Date fin
     $dateFin = new Text('dateFin');
     $dateFin->setLabel('Fin de la ligue')->setLabelAttributes(array('class', 'control-label'));
     $dateFin->setAttributes(array('id' => 'dateFin', 'class' => 'form-control'));
     //$this->add($dateFin);
     // Submit
     $submit = new Submit('submit');
     $submit->setValue('Enregistrer');
     $submit->setAttributes(array('class' => 'btn btn-primary'));
     $this->add($submit);
 }
开发者ID:baptcomet,项目名称:weprono,代码行数:35,代码来源:LigueForm.php

示例6: 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

示例7: __construct

 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);
 }
开发者ID:kayo-almeida,项目名称:cms-zend,代码行数:25,代码来源:HomeBannersForm.php

示例8: __construct

 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);
 }
开发者ID:pinnackl,项目名称:zend-project,代码行数:35,代码来源:PageForm.php

示例9: __construct

 public function __construct($name, $options = array())
 {
     parent::__construct($name, $options);
     $content = new Text('name');
     $content->setLabel('Nom de la catégorie :')->setAttributes(array('required' => true));
     $submit = new Submit('submit');
     $submit->setValue('Ajouter');
     $submit->setAttributes(array('class' => 'btn btn-primary'));
     $this->add($content)->add($submit);
 }
开发者ID:Nicolassouffleur,项目名称:zf2-blog,代码行数:10,代码来源:CategoryForm.php

示例10: __construct

 public function __construct($name, $options = array())
 {
     parent::__construct($name, $options);
     $content = new Textarea('content');
     $content->setLabel('Contenu de votre commentaire :')->setAttributes(array('required' => true));
     $submit = new Submit('submit');
     $submit->setValue('Ajouter');
     $submit->setAttributes(array('class' => 'btn btn-primary'));
     $this->add($content)->add($submit);
 }
开发者ID:Nicolassouffleur,项目名称:zf2-blog,代码行数:10,代码来源:CommentForm.php

示例11: __construct

 public function __construct($name = null)
 {
     parent::__construct('page');
     $id_hidden = new Element\Hidden('id');
     $id_hidden->setName('id');
     $title_text = new Element\Text('title');
     $title_text->setLabel('Title');
     $title_text->setLabelAttributes(array('class' => 'type_text type_text_short'));
     $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require'));
     $url_text = new Element\Text('url');
     $url_text->setLabel('Url');
     $url_text->setLabelAttributes(array('class' => 'type_text type_text_short'));
     $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require'));
     $text_textarea = new Element\Textarea('text');
     $text_textarea->setLabel('Text');
     $text_textarea->setLabelAttributes(array('class' => 'type_text'));
     $text_textarea->setAttributes(array('placeholder' => 'Type something...'));
     $auto_check = new Element\Checkbox('auto');
     $auto_check->setLabel('Automatically');
     $auto_check->setLabelAttributes(array('class' => 'type_text type_check'));
     $auto_check->setUseHiddenElement(true);
     $auto_check->setCheckedValue("1");
     $auto_check->setUncheckedValue("0");
     $auto_check->setValue('1');
     $meta_text = new Element\Text('meta');
     $meta_text->setLabel('Meta');
     $meta_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $meta_text->setAttributes(array('class' => 'type_text_input'));
     $keywords_text = new Element\Text('keywords');
     $keywords_text->setLabel('Keywords');
     $keywords_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $keywords_text->setAttributes(array('class' => 'type_text_input'));
     $desc_text = new Element\Text('description');
     $desc_text->setLabel('Description');
     $desc_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker'));
     $desc_text->setAttributes(array('class' => 'type_text_input'));
     $submit_button = new Element\Submit('submit');
     $submit_button->setValue('Submit');
     $submit_button->setAttributes(array('class' => 'btn btn_white'));
     $cancel_button = new Element\Submit('cancel');
     $cancel_button->setValue('Cancel');
     $cancel_button->setAttributes(array('class' => 'btn btn_rozy'));
     $this->add($id_hidden);
     $this->add($title_text);
     $this->add($url_text);
     $this->add($text_textarea);
     $this->add($auto_check);
     $this->add($meta_text);
     $this->add($keywords_text);
     $this->add($desc_text);
     $this->add($submit_button);
     $this->add($cancel_button);
 }
开发者ID:KukaBazuka,项目名称:zendy,代码行数:53,代码来源:PageForm.php

示例12: __construct

 public function __construct(EntityManager $entityManager)
 {
     parent::__construct();
     $this->entityManager = $entityManager;
     $this->setAttributes(array("method" => "post", "enctype" => "multipart/form-data", "class" => "form"));
     $this->setInputFilter(new FaqCategoriasFilters());
     // Campo de titulo
     $titulo = new Text('titulo');
     $titulo->setLabel("* Título")->setAttributes(array("maxLength" => "200", "class" => "form-control", "required" => "required"));
     // Botão de Submit
     $botao = new Submit("submit");
     $botao->setAttributes(array("value" => "Salvar"));
     // Adiciona campos
     $this->add($titulo)->add($botao);
 }
开发者ID:kayo-almeida,项目名称:cms-zend,代码行数:15,代码来源:FaqCategoriasForm.php

示例13: __construct

 public function __construct()
 {
     parent::__construct('auth');
     $this->setAttribute('method', 'post');
     $this->setAttributes(array('id' => 'auth', 'role' => 'form'));
     $this->setInputFilter(new AuthForgottenPasswordFilter());
     // Email
     $email = new Email('email');
     $email->setAttributes(array('id' => 'email', 'class' => 'form-control', 'placeholder' => 'Adresse email', 'required' => true, 'autofocus' => true));
     $this->add($email);
     // Submit
     $submit = new Submit('submit');
     $submit->setValue('Valider');
     $submit->setAttributes(array('class' => 'btn btn-primary btn-block'));
     $this->add($submit);
 }
开发者ID:baptcomet,项目名称:weprono,代码行数:16,代码来源:AuthForgottenPasswordForm.php

示例14: __construct

 /**
  * Formulaires de suppression
  */
 public function __construct()
 {
     parent::__construct('delete');
     $this->setAttribute('method', 'post');
     $this->setAttributes(array('id' => 'delete', 'role' => 'form'));
     // Non
     $no = new Submit('no');
     $no->setValue('Annuler');
     $no->setAttributes(array('id' => 'no', 'class' => 'btn btn-default'));
     $this->add($no);
     // Oui
     $yes = new Submit('yes');
     $yes->setValue('Supprimer définitivement');
     $yes->setAttributes(array('id' => 'yes', 'class' => 'btn btn-danger'));
     $this->add($yes);
 }
开发者ID:baptcomet,项目名称:weprono,代码行数:19,代码来源:DeleteForm.php

示例15: buildForm

 public function buildForm()
 {
     $this->setAttributes(array('id' => 'delete-form', 'method' => 'post'));
     $listingsId = new Element\Text('listings_id');
     $listingsId->setLabel('ID do Post');
     $listingsId->setAttributes(array('class' => 'form-control'));
     $deleteCode = new Element\Text('delete_code');
     $deleteCode->setAttribute('class', 'form-control');
     $deleteCode->setLabel('Código de deleção');
     $captcha = new Element\Captcha('captcha');
     $captchaAdapter = new ImageCaptcha(array('font' => './public/fonts/arial.ttf', 'imgDir' => './public/img/captcha', 'imgUrl' => '/img/captcha'));
     $captchaAdapter->setWordlen(4);
     $captcha->setCaptcha($captchaAdapter)->setLabel('Você é um ser humano ou um robô?')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Você é um ser humano ou um robô?');
     $csrf = new Element\Csrf('security');
     $submit = new Element\Submit('submit');
     $submit->setAttributes(array('class' => 'btn btn-default', 'value' => 'Enviar formulário'));
     $this->add($listingsId)->add($deleteCode)->add($captcha)->add($csrf)->add($submit);
 }
开发者ID:lohmuller,项目名称:OnlineMarket,代码行数:18,代码来源:DeleteForm.php


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