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


PHP Request::getMethod方法代码示例

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


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

示例1: addForm

 /**
  * Add a new form to the error form context
  *
  * @param BaseForm $form the errored form
  * @return $this
  */
 public function addForm(BaseForm $form)
 {
     $formErrorInformation = $this->request->getSession()->getFormErrorInformation();
     $this->set(get_class($form) . ":" . $form->getType(), $form);
     // Set form error information
     $formErrorInformation[get_class($form) . ":" . $form->getType()] = ['data' => $this->cleanFormData($form->getForm()->getData()), 'hasError' => $form->hasError(), 'errorMessage' => $form->getErrorMessage(), 'method' => $this->request->getMethod(), 'timestamp' => time(), 'validation_groups' => $form->getForm()->getConfig()->getOption('validation_groups')];
     $this->request->getSession()->setFormErrorInformation($formErrorInformation);
     return $this;
 }
开发者ID:jeremyFreeAgent,项目名称:thelia,代码行数:15,代码来源:ParserContext.php

示例2: addForm

 /**
  * Add a new form to the error form context
  *
  * @param BaseForm $form the errored form
  * @return $this
  */
 public function addForm(BaseForm $form)
 {
     $formErrorInformation = $this->request->getSession()->getFormErrorInformation();
     $this->set(get_class($form) . ":" . $form->getType(), $form);
     /** Remove unserializable objects \Symfony\Component\HttpFoundation\File\UploadedFile */
     $formData = $form->getForm()->getData();
     foreach ($formData as $idx => $value) {
         if ($value instanceof UploadedFile) {
             unset($formData[$idx]);
         }
     }
     // Set form error information
     $formErrorInformation[get_class($form) . ":" . $form->getType()] = ['data' => $formData, 'hasError' => $form->hasError(), 'errorMessage' => $form->getErrorMessage(), 'method' => $this->request->getMethod(), 'timestamp' => time(), 'validation_groups' => $form->getForm()->getConfig()->getOption('validation_groups')];
     $this->request->getSession()->setFormErrorInformation($formErrorInformation);
     return $this;
 }
开发者ID:NicolasMugnier,项目名称:thelia,代码行数:22,代码来源:ParserContext.php


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