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


PHP Form::getComponent方法代码示例

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


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

示例1: getComponent

 public function getComponent($name, $need = TRUE)
 {
     if (isset($this->dict[$name])) {
         $name = $this->dict[$name];
     }
     return parent::getComponent($name, $need);
 }
开发者ID:Vyki,项目名称:mva-dbm-example,代码行数:7,代码来源:MongoForm.php

示例2: formSucceed

 public function formSucceed(Form $form, $values)
 {
     $filter = [];
     foreach ($form->getComponent('filter')->getControls() as $component) {
         if ($component->name == 'limit') {
             if ($values->filter->limit != 50) {
                 $filter['limit'] = $values->filter->limit;
             }
         } elseif (!$component instanceof SubmitButton) {
             if (!empty($values->filter->{$component->name})) {
                 $filter[$component->name] = $values->filter->{$component->name};
             }
         }
     }
     if (!empty($filter)) {
         $this->filter = serialize($filter);
     } else {
         $this->filter = null;
     }
     $this->redirect('this');
 }
开发者ID:janlavicka,项目名称:datagrid,代码行数:21,代码来源:DataGrid.php

示例3: colorSelectFormSubmitted

 /**
  * @param Form $form
  */
 public function colorSelectFormSubmitted(Form $form)
 {
     $values = $form->getValues();
     $subquestion = $this->subquestion_service->saveBaseProperties($values);
     // rekonstrukce puvodnich id_pages
     $id_page = $this->question_service->get($subquestion->id_question)->id_page;
     $options = array();
     if ($subquestion->id_page_related !== null) {
         $related = $this->page_service->getRelatedPagesByFilter(new PageRelated(array(PageRelated::IDS_PAGE_RELATED => array($subquestion->id_page_related), \App\Base\Filter::GROUP_BY => true)));
         if (count($related) === 1 && $related[0] !== null) {
             $pages = $related[0]->getPagesRelatedAsArray();
             $options = array($pages[0]->getPage()->id_page => "", $pages[1]->getPage()->id_page => "");
         }
     }
     //        $pages = $this->page_service->getRelatedPages($id_page);
     //        $options = array($id_page=>"",$pages[0]->id_page);
     $form->getComponent("id_pages")->setItems($options);
     $values = $form->getValues();
     $subquestion->state = $values->id_pages === (int) $id_page ? \App\Model\Subquestion::STATE_CORRECT : \App\Model\Subquestion::STATE_WRONG;
     $subquestion->answer = $values->id_pages;
     $this->subquestion_service->save($subquestion);
     if ($form['cancel']->isSubmittedBy()) {
         $this->redirect("Survey:final");
     }
     if ($this->sessionSection->id_respondent === null) {
         $this->sessionSection->id_question = $subquestion->id_question;
         $this->redirect("Survey:personal");
     } else {
         $this->redirect("Survey:question");
     }
 }
开发者ID:bares43,项目名称:bachelor-thesis-survey,代码行数:34,代码来源:SurveyPresenter.php


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