File tree Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,13 @@ from the ``router`` service and override its settings::
7272 {
7373 protected function execute(InputInterface $input, OutputInterface $output)
7474 {
75- $context = $this->getContainer()->get('router')->getContext();
75+ $router = $this->getContainer()->get('router');
76+ $context = $router->getContext();
7677 $context->setHost('example.com');
7778 $context->setScheme('https');
7879 $context->setBaseUrl('my/path');
7980
80- // ... your code here
81+ $url = $router->generate('route-name', array('param-name' => 'param-value'));
82+ // ...
8183 }
8284 }
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ for example whether an uploaded file was too large or whether non-existing
2121fields were submitted.
2222
2323The submission of extra form fields can be controlled with the
24- `allow_extra_fields config option `_ and the maximum upload file size should be
25- handled via your PHP and web server configuration.
26-
27- .. _`allow_extra_fields config option` : https://symfony.com/doc/current/reference/forms/types/form.html#allow-extra-fields
24+ :ref: `allow_extra_fields config option <form-option-allow-extra-fields >` and
25+ the maximum upload file size should be handled via your PHP and web server
26+ configuration.
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ Field Options
5050
5151.. include :: /reference/forms/types/options/action.rst.inc
5252
53+ .. _form-option-allow-extra-fields :
54+
5355allow_extra_fields
5456~~~~~~~~~~~~~~~~~~
5557
Original file line number Diff line number Diff line change @@ -18,12 +18,16 @@ your application:
1818
1919.. code-block :: text
2020
21- homepage ANY /
22- contact GET /contact
23- contact_process POST /contact
24- article_show ANY /articles/{_locale}/{year}/{title}.{_format}
25- blog ANY /blog/{page}
26- blog_show ANY /blog/{slug}
21+ ------------------ -------- -------- ------ ----------------------------------------------
22+ Name Method Scheme Host Path
23+ ------------------ -------- -------- ------ ----------------------------------------------
24+ homepage ANY ANY ANY /
25+ contact GET ANY ANY /contact
26+ contact_process POST ANY ANY /contact
27+ article_show ANY ANY ANY /articles/{_locale}/{year}/{title}.{_format}
28+ blog ANY ANY ANY /blog/{page}
29+ blog_show ANY ANY ANY /blog/{slug}
30+ ------------------ -------- -------- ------ ----------------------------------------------
2731
2832 You can also get very specific information on a single route by including
2933the route name after the command:
You can’t perform that action at this time.
0 commit comments