File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -1000,7 +1000,11 @@ both ``app`` and ``checkout``:
1000
1000
.. code-block :: twig
1001
1001
1002
1002
{# templates/products/checkout.html.twig #}
1003
- {% block javascripts %}
1003
+ {#
1004
+ Override an "importmap" block in base.html.twig.
1005
+ If you don't have this, add it around the {{ importmap('app') }} call.
1006
+ #}
1007
+ {% block importmap %}
1004
1008
{# do NOT call parent() #}
1005
1009
1006
1010
{{ importmap('app', 'checkout') }}
@@ -1009,7 +1013,7 @@ both ``app`` and ``checkout``:
1009
1013
By passing both ``app `` and ``checkout ``, the ``importmap() `` function will
1010
1014
output the ``importmap `` and also add a ``<script type="module"> `` tag that
1011
1015
loads the ``app.js `` file *and * the ``checkout.js `` file. It's important
1012
- to *not * call ``parent() `` in the ``javascripts `` block. Each page can only
1016
+ to *not * call ``parent() `` in the ``importmap `` block. Each page can only
1013
1017
have *one * importmap, so ``importmap() `` must be called exactly once.
1014
1018
1015
1019
If, for some reason, you want to execute *only * ``checkout.js ``
Original file line number Diff line number Diff line change @@ -144,6 +144,16 @@ method to retrieve a new instance of the client with new default options::
144
144
'extra' => ['my-key' => 'my-value'],
145
145
]);
146
146
147
+ Alternatively, the :class: `Symfony\\ Component\\ HttpClient\\ HttpOptions ` class brings most of the available options with
148
+ type-hinted getters and setters::
149
+
150
+ $this->client = $client->withOptions(
151
+ (new HttpOptions())
152
+ ->setBaseUri('https://...')
153
+ ->setHeaders(['header-name' => 'header-value'])
154
+ ->toArray()
155
+ );
156
+
147
157
Some options are described in this guide:
148
158
149
159
* `Authentication `_
Original file line number Diff line number Diff line change @@ -1581,15 +1581,11 @@ information in a controller via the ``Request`` object::
1581
1581
}
1582
1582
}
1583
1583
1584
- You can get this information in services too injecting the ``request_stack ``
1585
- service to :doc: `get the Request object in a service </service_container/request >`.
1586
- In templates, use the :ref: `Twig global app variable <twig-app-variable >` to get
1587
- the current route and its attributes:
1588
-
1589
- .. code-block :: twig
1590
-
1591
- {% set route_name = app.current_route %}
1592
- {% set route_parameters = app.current_route_parameters %}
1584
+ In services, you can get this information by
1585
+ :doc: `injecting the RequestStack service </service_container/request >`.
1586
+ In templates, use the :ref: `Twig global app variable <twig-app-variable >`
1587
+ to get the current route name (``app.current_route ``) and its parameters
1588
+ (``app.current_route_parameters ``).
1593
1589
1594
1590
Special Routes
1595
1591
--------------
You can’t perform that action at this time.
0 commit comments