Skip to content

Commit fde1ab9

Browse files
ro0NLfabpot
authored andcommitted
[Asset] Provide default context
1 parent 9aa3498 commit fde1ab9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ CHANGELOG
5353
`EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`,
5454
`TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand`
5555
and `YamlLintCommand` classes have been marked as final
56+
* Added `asset.request_context.base_path` and `asset.request_context.secure` parameters
57+
to provide a default request context in case the stack is empty (similar to `router.request_context.*` parameters)
5658

5759
3.3.0
5860
-----

Resources/config/assets.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66

7+
<parameters>
8+
<parameter key="asset.request_context.base_path"></parameter>
9+
<parameter key="asset.request_context.secure">false</parameter>
10+
</parameters>
11+
712
<services>
813
<defaults public="false" />
914

@@ -19,6 +24,8 @@
1924

2025
<service id="assets.context" class="Symfony\Component\Asset\Context\RequestStackContext" public="true">
2126
<argument type="service" id="request_stack" />
27+
<argument>%asset.request_context.base_path%</argument>
28+
<argument>%asset.request_context.secure%</argument>
2229
</service>
2330

2431
<service id="assets.path_package" class="Symfony\Component\Asset\PathPackage" abstract="true" public="true">

0 commit comments

Comments
 (0)