本文整理匯總了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());
}