本文整理汇总了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;
}
示例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;
}