@@ -41,6 +41,7 @@ Configuration
41
41
* `base_urls `_
42
42
* `json_manifest_path `_
43
43
* `packages `_
44
+ * `strict `_
44
45
* `version_format `_
45
46
* `version_strategy `_
46
47
* `version `_
@@ -1842,6 +1843,7 @@ Each package can configure the following options:
1842
1843
* :ref: `version <reference-framework-assets-version >`
1843
1844
* :ref: `version_format <reference-assets-version-format >`
1844
1845
* :ref: `json_manifest_path <reference-assets-json-manifest-path >`
1846
+ * :ref: `strict <reference-assets-strict >`
1845
1847
1846
1848
.. _reference-framework-assets-version :
1847
1849
.. _ref-framework-assets-version :
@@ -2084,6 +2086,8 @@ package:
2084
2086
foo_package :
2085
2087
# this package uses its own manifest (the default file is ignored)
2086
2088
json_manifest_path : " %kernel.project_dir%/public/build/a_different_manifest.json"
2089
+ # for debug, an exception is thrown when an asset is not found in the manifest
2090
+ strict : " %kernel.debug%"
2087
2091
bar_package :
2088
2092
# this package uses the global manifest (the default file is used)
2089
2093
base_path : ' /images'
@@ -2104,9 +2108,11 @@ package:
2104
2108
<!-- you can use absolute URLs too and Symfony will download them automatically -->
2105
2109
<!-- <framework:assets json-manifest-path="https://cdn.example.com/manifest.json"> -->
2106
2110
<!-- this package uses its own manifest (the default file is ignored) -->
2111
+ <!-- for debug, an exception is thrown when an asset is not found in the manifest -->
2107
2112
<framework : package
2108
2113
name =" foo_package"
2109
- json-manifest-path =" %kernel.project_dir%/public/build/a_different_manifest.json" />
2114
+ json-manifest-path =" %kernel.project_dir%/public/build/a_different_manifest.json"
2115
+ strict =" true" />
2110
2116
<!-- this package uses the global manifest (the default file is used) -->
2111
2117
<framework : package
2112
2118
name =" bar_package"
@@ -2128,6 +2134,8 @@ package:
2128
2134
'foo_package' => [
2129
2135
// this package uses its own manifest (the default file is ignored)
2130
2136
'json_manifest_path' => '%kernel.project_dir%/public/build/a_different_manifest.json',
2137
+ // for debug, an exception is thrown when an asset is not found in the manifest
2138
+ 'strict' => '%kernel.debug%',
2131
2139
],
2132
2140
'bar_package' => [
2133
2141
// this package uses the global manifest (the default file is used)
@@ -2152,11 +2160,21 @@ package:
2152
2160
2153
2161
If you request an asset that is *not found * in the ``manifest.json `` file, the original -
2154
2162
*unmodified * - asset path will be returned.
2163
+ Set `strict ` to `true ` to get an exception when an asset is *not found *.
2155
2164
2156
2165
.. note ::
2157
2166
2158
2167
If an URL is set, the JSON manifest is downloaded on each request using the `http_client `_.
2159
2168
2169
+ strict
2170
+ ......
2171
+
2172
+ **type **: ``boolean `` **default **: ``false ``
2173
+
2174
+ .. versionadded :: 5.2
2175
+
2176
+ This option was introduced in Symfony 5.2.
2177
+
2160
2178
translator
2161
2179
~~~~~~~~~~
2162
2180
0 commit comments