8000 Added docs for clickLink() and submitForm() by javiereguiluz · Pull Request #10071 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added docs for clickLink() and submitForm() #10071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reword
  • Loading branch information
javiereguiluz committed Jul 18, 2018
commit 83b7322b52f2e57dbef0a25c3b5bcc02c878c561
24 changes: 10 additions & 14 deletions components/browser_kit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,23 @@ field values, etc.) before submitting it::
// 'Log in' can be the text content, id, value or name of a <button> or <input type="submit">
$client->submitForm('Log in');

// same as above, but override the default form field values
// the second optional argument lets you override the default form field values
$client->submitForm('Log in', array(
'login' => 'my_user',
'password' => 'my_pass',
// to upload a file, the value must be the absolute file path
'file' => __FILE__,
));

// same as above, but also override the default form HTTP method
$client->submitForm('Log in', array(
'login' => 'my_user',
'password' => 'my_pass',
), 'PUT');

// same as above, but also override some $_SERVER parameters (e.g. HTTP headers)
$client->submitForm('Log in', array(
'login' => 'my_user',
'password' => 'my_pass',
), 'PUT', array(
'HTTP_ACCEPT_LANGUAGE' => 'es',
));
// you can override other form options too
$client->submitForm(
'Log in',
array('login' => 'my_user', 'password' => 'my_pass'),
// override the default form HTTP method
'PUT',
// override some $_SERVER parameters (e.g. HTTP headers)
array('HTTP_ACCEPT_LANGUAGE' => 'es')
);

.. versionadded:: 4.2
The ``submitForm()`` method was introduced in Symfony 4.2.
Expand Down
0