File tree 4 files changed +19
-12
lines changed
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::
72
72
{
73
73
protected function execute(InputInterface $input, OutputInterface $output)
74
74
{
75
- $context = $this->getContainer()->get('router')->getContext();
75
+ $router = $this->getContainer()->get('router');
76
+ $context = $router->getContext();
76
77
$context->setHost('example.com');
77
78
$context->setScheme('https');
78
79
$context->setBaseUrl('my/path');
79
80
80
- // ... your code here
81
+ $url = $router->generate('route-name', array('param-name' => 'param-value'));
82
+ // ...
81
83
}
82
84
}
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
21
21
fields were submitted.
22
22
23
23
The 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
50
50
51
51
.. include :: /reference/forms/types/options/action.rst.inc
52
52
53
+ .. _form-option-allow-extra-fields :
54
+
53
55
allow_extra_fields
54
56
~~~~~~~~~~~~~~~~~~
55
57
Original file line number Diff line number Diff line change @@ -18,12 +18,16 @@ your application:
18
18
19
19
.. code-block :: text
20
20
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
+ ------------------ -------- -------- ------ ----------------------------------------------
27
31
28
32
You can also get very specific information on a single route by including
29
33
the route name after the command:
You can’t perform that action at this time.
0 commit comments