本文整理汇总了PHP中Symfony\Component\DomCrawler\Form::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getValues方法的具体用法?PHP Form::getValues怎么用?PHP Form::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\DomCrawler\Form
的用法示例。
在下文中一共展示了Form::getValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: isValid
public function isValid(Form $form)
{
if ($form->has('token')) {
$values = $form->getValues();
$values['token'] = 'modified by csrf scanner';
$form->setValues($values);
$this->client->submit($form);
$status = $this->client->getResponse()->getStatus();
if (403 == $status) {
return true;
}
$this->message = "403 response expected, but got a {$status}";
} else {
$this->message = "No 'token' input field found";
}
return false;
}
示例3: extractParametersFromForm
/**
* Extract the parameters from the given form.
*
* @param \Symfony\Component\DomCrawler\Form $form
* @return array
*/
protected function extractParametersFromForm(Form $form)
{
parse_str(http_build_query($form->getValues()), $parameters);
return $parameters;
}
示例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());
}