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


PHP Form::setMethod方法代码示例

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


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

示例1: createComponentSearch

 public function createComponentSearch()
 {
     $form = new Form();
     $form->setMethod('get');
     $form->addText('search', '');
     $form->addSubmit('submit', 'Hľadaj');
     return $form;
 }
开发者ID:hleumas,项目名称:databaza,代码行数:8,代码来源:RiesiteliaPresenter.php

示例2: createComponentForm

 protected function createComponentForm()
 {
     $form = new Form();
     $form->setMethod(Form::GET);
     $form->addPassword('password', 'Password')->setRequired();
     $form->addSubmit('submit', 'Generate');
     return $form;
 }
开发者ID:nella,项目名称:simple-hash-authenticator,代码行数:8,代码来源:PasswordHashGeneratorPresenter.php

示例3: createComponentQuickSearchForm

 /**
  * Quick Search form factory.
  *
  * @return \Nette\Application\UI\Form
  */
 protected function createComponentQuickSearchForm()
 {
     $form = new Form();
     $form->setMethod('GET');
     $form->addText('q', 'Query:');
     $form->addCheckboxList('filter', 'filter', ['light' => 'LIGHT', 'large' => 'LARGE']);
     $form->addSubmit('search', 'Search');
     $filter = [];
     if ($this->filterLight) {
         $filter[] = 'light';
     }
     if ($this->filterLarge) {
         $filter[] = 'large';
     }
     $form->setDefaults(['q' => $this->fulltextQuery, 'filter' => $filter]);
     $form->onSuccess[] = $this->quickSearchFormSucceeded;
     return $form;
 }
开发者ID:Aprila,项目名称:laboratory,代码行数:23,代码来源:ListExamplePresenter.php

示例4: createComponentForm

 public function createComponentForm()
 {
     $form = new Form();
     $form->setMethod('get')->setAction($this->parent->link('this'));
     $semestre = FlatArray::toArray($this->semesterSource->getAll());
     $serie = $this->seriaSource->getAll();
     $items = array();
     foreach ($semestre as &$sem) {
         $sem['serie'] = array();
     }
     foreach ($serie as $seria) {
         $semestre[$seria['semester']]['serie'][] = $seria;
     }
     foreach ($semestre as $semester) {
         $name = "{$semester['rok']} " . ($semester['cast'] == 1 ? 'leto' : 'zima');
         $items[$name] = array();
         foreach ($semester['serie'] as $seria) {
             $items[$name][$seria['id']] = "{$seria['cislo']}. séria";
         }
     }
     $form->addSelect('seria', 'Séria:', $items)->setValue($this->selected);
     $form->addSubmit('submit', 'Načítaj');
     return $form;
 }
开发者ID:hleumas,项目名称:databaza,代码行数:24,代码来源:SeriaSelector.php

示例5: createComponentFilter

 /**
  * FilterAndGroupAction form factory
  * @return Form
  */
 public function createComponentFilter()
 {
     $form = new Form($this, 'filter');
     $form->setMethod('get');
     /**
      * Filter part
      */
     $filter_container = $form->addContainer('filter');
     foreach ($this->filters as $filter) {
         $filter->addToFormContainer($filter_container, $filter_container);
     }
     /**
      * Group action part
      */
     $group_action_container = $form->addContainer('group_action');
     if ($this->hasGroupActions()) {
         $this->getGroupActionCollection()->addToFormContainer($group_action_container, $form, $this->getTranslator());
     }
     $form->setDefaults(['filter' => $this->filter]);
     $form->onSubmit[] = [$this, 'filterSucceeded'];
     return $form;
 }
开发者ID:JakubKontra,项目名称:datagrid,代码行数:26,代码来源:DataGrid.php

示例6: createComponentFilter

 /**
  * FilterAndGroupAction form factory
  * @return Form
  */
 public function createComponentFilter()
 {
     $form = new Form($this, 'filter');
     $form->setMethod('get');
     $form->setTranslator($this->getTranslator());
     /**
      * InlineEdit part
      */
     $inline_edit_container = $form->addContainer('inline_edit');
     if ($this->inlineEdit instanceof InlineEdit) {
         $inline_edit_container->addSubmit('submit', 'ublaboo_datagrid.save');
         $inline_edit_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')->setValidationScope(FALSE);
         $this->inlineEdit->onControlAdd($inline_edit_container);
     }
     /**
      * InlineAdd part
      */
     $inline_add_container = $form->addContainer('inline_add');
     if ($this->inlineAdd instanceof InlineEdit) {
         $inline_add_container->addSubmit('submit', 'ublaboo_datagrid.save');
         $inline_add_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')->setValidationScope(FALSE)->setAttribute('data-datagrid-cancel-inline-add', TRUE);
         $this->inlineAdd->onControlAdd($inline_add_container);
     }
     /**
      * ItemDetail form part
      */
     $items_detail_form = $this->getItemDetailForm();
     if ($items_detail_form instanceof Nette\Forms\Container) {
         $form['items_detail_form'] = $items_detail_form;
     }
     /**
      * Filter part
      */
     $filter_container = $form->addContainer('filter');
     foreach ($this->filters as $filter) {
         $filter->addToFormContainer($filter_container);
     }
     /**
      * Group action part
      */
     $group_action_container = $form->addContainer('group_action');
     if ($this->hasGroupActions()) {
         $this->getGroupActionCollection()->addToFormContainer($group_action_container);
     }
     $form->setDefaults(['filter' => $this->filter]);
     $form->onSubmit[] = [$this, 'filterSucceeded'];
     return $form;
 }
开发者ID:OCC2,项目名称:occ2pacs,代码行数:52,代码来源:DataGrid.php

示例7: createComponentFilter

 /**
  * FilterAndGroupAction form factory
  * @return Form
  */
 public function createComponentFilter()
 {
     $form = new Form($this, 'filter');
     $form->setMethod(static::$form_method);
     $form->setTranslator($this->getTranslator());
     /**
      * InlineEdit part
      */
     $inline_edit_container = $form->addContainer('inline_edit');
     if ($this->inlineEdit instanceof InlineEdit) {
         $inline_edit_container->addSubmit('submit', 'ublaboo_datagrid.save');
         $inline_edit_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')->setValidationScope(FALSE);
         $this->inlineEdit->onControlAdd($inline_edit_container);
         $this->inlineEdit->onControlAfterAdd($inline_edit_container);
     }
     /**
      * InlineAdd part
      */
     $inline_add_container = $form->addContainer('inline_add');
     if ($this->inlineAdd instanceof InlineEdit) {
         $inline_add_container->addSubmit('submit', 'ublaboo_datagrid.save');
         $inline_add_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')->setValidationScope(FALSE)->setAttribute('data-datagrid-cancel-inline-add', TRUE);
         $this->inlineAdd->onControlAdd($inline_add_container);
         $this->inlineAdd->onControlAfterAdd($inline_add_container);
     }
     /**
      * ItemDetail form part
      */
     $items_detail_form = $this->getItemDetailForm();
     if ($items_detail_form instanceof Nette\Forms\Container) {
         $form['items_detail_form'] = $items_detail_form;
     }
     /**
      * Filter part
      */
     $filter_container = $form->addContainer('filter');
     foreach ($this->filters as $filter) {
         $filter->addToFormContainer($filter_container);
     }
     if (!$this->hasAutoSubmit()) {
         $filter_container['submit'] = $this->getFilterSubmitButton();
     }
     /**
      * Group action part
      */
     $group_action_container = $form->addContainer('group_action');
     if ($this->hasGroupActions()) {
         $this->getGroupActionCollection()->addToFormContainer($group_action_container);
     }
     if (!$form->isSubmitted()) {
         $this->setFilterContainerDefaults($form['filter'], $this->filter);
     }
     /**
      * Per page part
      */
     $form->addSelect('per_page', '', $this->getItemsPerPageList())->setTranslator(NULL);
     if (!$form->isSubmitted()) {
         $form['per_page']->setValue($this->getPerPage());
     }
     $form->addSubmit('per_page_submit', 'ublaboo_datagrid.per_page_submit');
     $form->onSubmit[] = [$this, 'filterSucceeded'];
 }
开发者ID:ublaboo,项目名称:datagrid,代码行数:66,代码来源:DataGrid.php

示例8: createComponentLoginForm

 /**
  * Login form factory.
  * @return \Nette\Application\UI\Form
  */
 protected function createComponentLoginForm()
 {
     $form = new Nette\Application\UI\Form();
     $form->setMethod('POST');
     $form->addText('email', 'E-mail:')->setRequired('You have to input your e-mail!')->setAttribute('type', 'email')->setAttribute('placeholder', 'E-mail')->setAttribute('class', 'text');
     $form->addPassword('password', 'Password:')->setRequired('You have to input password!')->setAttribute('placeholder', 'Password')->setAttribute('class', 'text');
     $form->addCheckbox('remember', ' Keep me logged in for 2 week...');
     $form->addSubmit('submit', 'Log in...')->setAttribute('class', 'button');
     // call method signInFormSucceeded() on success
     $form->onSuccess[] = function (Nette\Application\UI\Form $form, $values) {
         if ($values->remember) {
             $this->getUser()->setExpiration('14 days', false, true);
         } else {
             $this->getUser()->setExpiration('20 minutes', true, true);
         }
         try {
             $this->getUser()->login($values->email, $values->password);
             $this->usersFacade->cleanForgottenPasswords($this->getUser()->id);
             $this->flashMessageLoginSuccess();
             $this->finalRedirect();
         } catch (Nette\Security\AuthenticationException $e) {
             $form->addError($e->getMessage());
         }
     };
     return $form;
 }
开发者ID:kizi,项目名称:easyminer-easyminercenter,代码行数:30,代码来源:UserPresenter.php

示例9: createComponentSemesterSelect

 public function createComponentSemesterSelect()
 {
     $form = new Form();
     $form->setMethod('get');
     $semestre = $this->context->sources->semesterSource->getAll();
     $items = array();
     $cast = array(1 => 'leto', 2 => 'zima');
     foreach ($semestre as $id => $semester) {
         $items[$id] = "{$semester['rok']} {$cast[$semester['cast']]}";
     }
     $form->addSelect('semester', 'Semester:', $items)->setValue($this->getSemesterId());
     $form->addSubmit('nacitaj', 'Načítaj');
     return $form;
 }
开发者ID:hleumas,项目名称:databaza,代码行数:14,代码来源:SeriePresenter.php

示例10: createComponentForumTopicsForm

 /**
  * Form to show list of topics with checkboxes
  *
  * @access protected
  * @return Nette\Application\UI\Form
  * @since 1.0.0
  */
 protected function createComponentForumTopicsForm()
 {
     $form = new UI\Form();
     $form->setMethod('get');
     $container = $form->addContainer($this->forumSelectedTopicsContainer);
     foreach ($this->forumThreads as $thread) {
         $container->addCheckbox($thread->id_thread, $thread->title);
     }
     $form->addSubmit('show', 'View selected');
     return $form;
 }
开发者ID:radekdostal,项目名称:Nette-ForumControl,代码行数:18,代码来源:ForumControl.php


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