本文整理汇总了PHP中Symfony\Component\DomCrawler\Form::getMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getMethod方法的具体用法?PHP Form::getMethod怎么用?PHP Form::getMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\DomCrawler\Form
的用法示例。
在下文中一共展示了Form::getMethod方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeRequestUsingForm
protected function makeRequestUsingForm(Form $form)
{
$files = [];
$plainFiles = $form->getFiles();
foreach ($plainFiles as $key => $file) {
$files[$key] = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error'], true);
}
return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $files);
}
示例2: submit
/**
* Submits a form.
*
* @param Form $form A Form instance
* @param array $values An array of form field values
*
* @api
*/
public function submit(Form $form, array $values = array())
{
$form->setValues($values);
return $this->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles());
}
示例3: makeRequestUsingForm
/**
* Make a request to the application using the given form.
*
* @param \Symfony\Component\DomCrawler\Form $form
* @return $this
*/
protected function makeRequestUsingForm(Form $form)
{
return $this->makeRequest($form->getMethod(), $form->getUri(), $this->extractParametersFromForm($form), [], $form->getFiles());
}
示例4: makeRequestUsingForm
/**
* Make a request to a URL using form parameters.
*
* @param Form $form
* @return static
*/
protected function makeRequestUsingForm(Form $form)
{
return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $form->getFiles());
}
示例5: submit
/**
* Submit a form
*
* @param \Symfony\Component\DomCrawler\Form $form
* @return \TYPO3\Flow\Http\Response
* @api
*/
public function submit(Form $form)
{
return $this->request($form->getUri(), $form->getMethod(), $form->getPhpValues(), $form->getPhpFiles());
}
示例6: disableModuleAsync
/**
* @param Form $form
* @param string $package
* @param string $slug
* @param Session $session
*
* @return Promise
*
* @rejects RequestException
*/
public function disableModuleAsync(Form $form, $package, $slug, Session $session)
{
$formData = $form->getPhpValues();
if (empty($formData['modules'][$package][$slug]['enable'])) {
// The module is already disabled.
return new FulfilledPromise(null);
}
unset($formData['modules'][$package][$slug]['enable']);
return $this->client->requestAsync($form->getMethod(), $form->getUri(), [RequestOptions::COOKIES => $session->getCookieJar(), RequestOptions::AUTH => $session->getAuthData(), RequestOptions::FORM_PARAMS => $formData, RequestOptions::HEADERS => ['referer' => $form->getUri()], RequestOptions::ALLOW_REDIRECTS => false])->then(function () {
// Resolve to null.
});
}