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


PHP Form::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Class constructor.
  */
 public function __construct(ProjectService $projectService)
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-horizontal');
     $this->setAttribute('id', 'create-report');
     /*
      * Create an array with possible periods. This will trigger a date but display a period (semester)
      */
     $semesterOptions = [];
     foreach ($projectService->parseYearRange() as $year) {
         /*
          * Use the Report object to parse the data
          */
         $report = new Report();
         $report->setDatePeriod(\DateTime::createFromFormat('Y-m-d', $year . '-03-01'));
         $semesterOptions[$year . '-1'] = $report->parseName();
         $report->setDatePeriod(\DateTime::createFromFormat('Y-m-d', $year . '-09-01'));
         $semesterOptions[$year . '-2'] = $report->parseName();
     }
     $this->add(['type' => 'Zend\\Form\\Element\\Select', 'name' => 'period', 'options' => ['label' => _("txt-report-period"), 'help-block' => _("txt-report-period-explanation"), 'value_options' => $semesterOptions], 'attributes' => ['class' => "form-control", 'id' => "period"]]);
     $this->add(['type' => 'Zend\\Form\\Element\\Text', 'name' => 'item', 'options' => ['label' => _("txt-document-name"), 'help-block' => _("txt-document-name-explanation")], 'attributes' => ['placeholder' => _("txt-please-give-a-document-name")]]);
     $this->add(['type' => '\\Zend\\Form\\Element\\File', 'name' => 'file', 'options' => ["label" => "txt-file", "help-block" => _("txt-file-requirements")]]);
     $this->add(['type' => 'Zend\\Form\\Element\\Submit', 'name' => 'submit', 'attributes' => ['class' => "btn btn-primary", 'value' => _("txt-create")]]);
     $this->add(['type' => 'Zend\\Form\\Element\\Submit', 'name' => 'cancel', 'attributes' => ['class' => "btn btn-warning", 'value' => _("txt-cancel")]]);
 }
开发者ID:debranova,项目名称:project,代码行数:29,代码来源:CreateReport.php

示例2: __construct

 public function __construct($name = null)
 {
     parent::__construct('bibtex');
     $this->setAttribute('id', 'form_bibtex');
     $this->add(array('name' => 'bibtex', 'type' => 'File', 'required' => true, 'attributes' => array('id' => 'upload'), 'options' => array('label' => 'Importer fichier Bibtex')));
     $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => 'Valider', 'id' => 'submitBibtex')));
 }
开发者ID:skynex,项目名称:ProjetLicence,代码行数:7,代码来源:BibtexPublicationForm.php

示例3: __construct

 public function __construct($name = null)
 {
     parent::__construct('registration');
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'usr_email', 'attributes' => array('type' => 'email'), 'options' => array('label' => 'E-mail')));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton')));
 }
开发者ID:randjo,项目名称:ZF2-App,代码行数:7,代码来源:ForgottenPasswordForm.php

示例4: __construct

 public function __construct($placeholder)
 {
     parent::__construct('busca');
     $this->setAttribute('method', 'post');
     $this->setAttribute('action', '');
     $this->add(array('name' => 'search', 'type' => 'Text', 'options' => array('label' => ''), 'attributes' => array('id' => 'search', 'class' => 'form-control input-sm', 'placeholder' => $placeholder)));
 }
开发者ID:ChristianKolling,项目名称:ctg,代码行数:7,代码来源:Busca.php

示例5: __construct

 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);
 }
开发者ID:aaron4m,项目名称:zf2-mailchimp,代码行数:26,代码来源:SubscriptionForm.php

示例6: __construct

 public function __construct()
 {
     parent::__construct(__CLASS__);
     $this->add(array('name' => 'email'));
     $this->add(array('name' => 'password'));
     $this->add(array('name' => 'rememberme'));
 }
开发者ID:ppLuiGui,项目名称:rally,代码行数:7,代码来源:LoginForm.php

示例7: __construct

 /**
  * @inheritdoc
  */
 public function __construct($name = null, $options = array())
 {
     parent::__construct($name, $options);
     $this->add(array('name' => 'title', 'type' => 'Text', 'options' => array('label' => '* Nome'), 'attributes' => array('required' => 'required', 'placeholder' => 'Titolo...', 'title' => 'Inserisci il titolo', 'id' => 'title')));
     $this->add(array('name' => 'messageText', 'type' => 'Textarea', 'options' => array('label' => 'Testo'), 'attributes' => array('id' => 'messageText', 'required' => 'required', 'rows' => 10)));
     $this->add(array('type' => 'Zend\\Form\\Element\\Hidden', 'name' => 'id', 'attributes' => array("class" => 'hiddenField')));
 }
开发者ID:usban,项目名称:entilocali,代码行数:10,代码来源:NewsletterForm.php

示例8: __construct

 public function __construct()
 {
     parent::__construct('venda');
     $this->setHydrator(new ClassMethods());
     $this->add(array('name' => 'id', 'type' => 'hidden'));
     $this->add(array('name' => 'submit', 'type' => 'submit', 'attributes' => array('value' => 'Nova venda', 'id' => 'btnSubmit', 'class' => 'btn btn-primary')));
 }
开发者ID:LucasBurg,项目名称:glass,代码行数:7,代码来源:VendaForm.php

示例9: __construct

 public function __construct($name = null, array $departamentos = null)
 {
     parent::__construct('usuario');
     $this->departamentos = $departamentos;
     $this->setAttribute('method', 'post');
     $this->setInputFilter(new UsuarioFilter());
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'matricula', 'options' => array('type' => 'text'), 'attributes' => array('id' => 'matricula', 'placeholder' => 'Número da matricula', 'class' => 'form-control input-lg')));
     $this->add(array('name' => 'admissao', 'options' => array('type' => 'text'), 'attributes' => array('id' => 'admissao', 'placeholder' => 'Data de Admissao', 'class' => 'form-control input-lg')));
     $this->add(array('name' => 'nome', 'options' => array('type' => 'text'), 'attributes' => array('id' => 'nome', 'placeholder' => 'Nome', 'class' => 'form-control input-lg')));
     $departamento = new Select();
     $departamento->setName('departamento')->setOptions(array('empty_option' => 'Departamento do usuario', 'value_options' => $this->departamentos))->setAttributes(array('class' => 'form-control input-lg'));
     $this->add($departamento);
     $this->add(array('name' => 'foto', 'attributes' => array('type' => 'file', 'id' => 'foto')));
     $this->add(array('name' => 'dataNascimento', 'options' => array('type' => 'text'), 'attributes' => array('id' => 'dataNascimento', 'placeholder' => 'Data de Nascimento', 'class' => 'form-control input-lg')));
     $this->add(array('name' => 'email', 'options' => array('type' => 'email'), 'attributes' => array('id' => 'email', 'placeholder' => 'E-mail', 'class' => 'form-control input-lg')));
     $this->add(array('name' => 'password', 'options' => array('type' => 'Password'), 'attributes' => array('id' => 'password', 'placeholder' => 'Senha', 'class' => 'form-control input-lg', 'type' => 'password')));
     $status = new Select();
     $status->setName('status')->setOptions(array('empty_option' => 'Tipo de Usuario', 'value_options' => array('0' => 'Administrador', '1' => 'Colaborador', '2' => 'Visitante')))->setAttributes(array('class' => 'form-control input-lg'));
     $this->add($status);
     /*$ativo = new \Zend\Form\Element\Checkbox("ativo");
       $ativo->setLabel("Desativar?: ");
       $ativo->setCheckedValue("0");
       $this->add($ativo);*/
     $this->add(array('type' => 'Zend\\Form\\Element\\Checkbox', 'name' => 'ativo', 'options' => array('label' => 'Desativar?:', 'use_hidden_element' => true, 'checked_value' => 0, 'unchecked_value' => 1)));
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Salvar', 'class' => 'btn btn-primary')));
 }
开发者ID:lucasfbr,项目名称:assistente,代码行数:28,代码来源:Usuario.php

示例10: __construct

 public function __construct()
 {
     parent::__construct('login');
     $this->add(array('name' => 'nick', 'type' => 'Text'));
     $this->add(array('name' => 'heslo', 'type' => 'Password'));
     $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => 'Přihlásit', 'class' => 'btn btn-info')));
 }
开发者ID:kouks,项目名称:Trinec,代码行数:7,代码来源:LoginForm.php

示例11: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     //titolo
     $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //contenuto
     $nota = new Element\Textarea('contenuto');
     $nota->setLabel('Contenuto');
     $nota->setAttribute('class', 'ckeditor form-control');
     $this->add($nota);
     //Background
     $this->add(array('name' => 'background', 'attributes' => array('type' => 'Zend\\Form\\Element\\File'), 'options' => array('label' => 'Background')));
     // Posterlab
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posterlab', 'options' => array('label' => 'Posterlab', 'empty_option' => 'Scegli un posterlab =>'), 'attributes' => array('class' => 'form-control', 'onChange' => 'javascript:caricaPosizioni()', 'id' => 'posterlabs')));
     // Posizione
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posizione', 'options' => array('label' => 'posizione', 'empty_option' => 'Scegli una posizione =>', 'disable_inarray_validator' => true), 'attributes' => array('class' => 'form-control', 'id' => 'posizioni')));
     // tipo
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'tipo', 'options' => array('label' => 'Tipo', 'empty_option' => 'Scegli tipo =>'), 'attributes' => array('class' => 'form-control')));
     //stato
     $stato = new Element\Checkbox('stato');
     $stato->setLabel('Stato');
     $stato->setAttribute('class', 'make-switch');
     $this->add($stato);
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right')));
 }
开发者ID:sebaxplace,项目名称:skilla-local,代码行数:27,代码来源:Content.php

示例12: __construct

 public function __construct($name, $options = [])
 {
     parent::__construct($name, $options);
     $this->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf', 'attributes' => array('id' => 'csrf')));
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('type' => 'submit', 'value' => 'Batch Submit', 'id' => 'listsubmit', 'class' => 'btn btn-primary')));
     $this->setInputFilter(new InputFilter());
 }
开发者ID:arstropica,项目名称:zf2-dashboard,代码行数:7,代码来源:SubmitForm.php

示例13: __construct

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

示例14: __construct

 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')));
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:27,代码来源:NewsForm.php

示例15: __construct

 public function __construct($name = null)
 {
     parent::__construct('SarePrices-form');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'client-form');
     $this->add(array('name' => 'email', 'required' => true, 'attributes' => array('type' => 'email', 'placeholder' => 'Ваш email*', 'id' => 'form-email')));
     //        $this->add(array(
     //            'type' => 'Zend\Form\Element\Captcha',
     //            'name' => 'captcha',
     //            'attributes' => array(
     //                'class' => 'form-control',
     //                'placeholder' => 'Введите текст*'
     //            ),
     //            'options' => array(
     //                'captcha' => new Captcha\Figlet(array(
     //                    'name' => 'foo',
     //                    'wordLen' => 4,
     //                    'timeout' => 300,
     //                    'messages' => array(
     //                        'badCaptcha' => 'Неправильно введена каптча!'
     //                    )
     //                        )),
     //            ),
     //        ));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'УЗНАТЬ СТОИМОСТЬ ПО АКЦИИ', 'id' => 'form-submit', 'data-form' => 'Form2')));
 }
开发者ID:AlexanderGrishkevich,项目名称:abc,代码行数:27,代码来源:SharePricesForm.php


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