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``:
10001000.. code-block :: twig
10011001
10021002 {# 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 %}
10041008 {# do NOT call parent() #}
10051009
10061010 {{ importmap('app', 'checkout') }}
@@ -1009,7 +1013,7 @@ both ``app`` and ``checkout``:
10091013 By passing both ``app `` and ``checkout ``, the ``importmap() `` function will
10101014output the ``importmap `` and also add a ``<script type="module"> `` tag that
10111015loads 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
10131017have *one * importmap, so ``importmap() `` must be called exactly once.
10141018
10151019If, 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::
144144 'extra' => ['my-key' => 'my-value'],
145145 ]);
146146
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+
147157Some options are described in this guide:
148158
149159* `Authentication `_
Original file line number Diff line number Diff line change @@ -1581,15 +1581,11 @@ information in a controller via the ``Request`` object::
15811581 }
15821582 }
15831583
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 ``).
15931589
15941590Special Routes
15951591--------------
You can’t perform that action at this time.
0 commit comments