@@ -41,6 +41,7 @@ Configuration
4141 * `base_urls `_
4242 * `json_manifest_path `_
4343 * `packages `_
44+ * `strict_mode `_
4445 * `version_format `_
4546 * `version_strategy `_
4647 * `version `_
@@ -1933,6 +1934,7 @@ Each package can configure the following options:
19331934* :ref: `version <reference-framework-assets-version >`
19341935* :ref: `version_format <reference-assets-version-format >`
19351936* :ref: `json_manifest_path <reference-assets-json-manifest-path >`
1937+ * :ref: `strict_mode <reference-assets-strict-mode >`
19361938
19371939.. _reference-framework-assets-version :
19381940.. _ref-framework-assets-version :
@@ -2175,6 +2177,8 @@ package:
21752177 foo_package :
21762178 # this package uses its own manifest (the default file is ignored)
21772179 json_manifest_path : " %kernel.project_dir%/public/build/a_different_manifest.json"
2180+ # for debug, an exception is thrown when an asset is not found in the manifest
2181+ strict_mode : " %kernel.debug%"
21782182 bar_package :
21792183 # this package uses the global manifest (the default file is used)
21802184 base_path : ' /images'
@@ -2195,9 +2199,11 @@ package:
21952199 <!-- you can use absolute URLs too and Symfony will download them automatically -->
21962200 <!-- <framework:assets json-manifest-path="https://cdn.example.com/manifest.json"> -->
21972201 <!-- this package uses its own manifest (the default file is ignored) -->
2202+ <!-- for debug, an exception is thrown when an asset is not found in the manifest -->
21982203 <framework : package
21992204 name =" foo_package"
2200- json-manifest-path =" %kernel.project_dir%/public/build/a_different_manifest.json" />
2205+ json-manifest-path =" %kernel.project_dir%/public/build/a_different_manifest.json"
2206+ strict-mode =" true" />
22012207 <!-- this package uses the global manifest (the default file is used) -->
22022208 <framework : package
22032209 name =" bar_package"
@@ -2219,6 +2225,8 @@ package:
22192225 'foo_package' => [
22202226 // this package uses its own manifest (the default file is ignored)
22212227 'json_manifest_path' => '%kernel.project_dir%/public/build/a_different_manifest.json',
2228+ // for debug, an exception is thrown when an asset is not found in the manifest
2229+ 'strict_mode' => '%kernel.debug%',
22222230 ],
22232231 'bar_package' => [
22242232 // this package uses the global manifest (the default file is used)
@@ -2243,11 +2251,21 @@ package:
22432251
22442252 If you request an asset that is *not found * in the ``manifest.json `` file, the original -
22452253 *unmodified * - asset path will be returned.
2254+ Set `strict_mode ` to `true ` to get an exception when an asset is *not found *.
22462255
22472256.. note ::
22482257
22492258 If an URL is set, the JSON manifest is downloaded on each request using the `http_client `_.
22502259
2260+ strict_mode
2261+ ...........
2262+
2263+ **type **: ``boolean `` **default **: ``false ``
2264+
2265+ .. versionadded :: 5.2
2266+
2267+ This option was introduced in Symfony 5.2.
2268+
22512269translator
22522270~~~~~~~~~~
22532271
0 commit comments