Skip to content

Commit 1a4d99b

Browse files
authored
Better code sample for strict manifest
1 parent 8f1fbe4 commit 1a4d99b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

components/asset.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,12 @@ not listed in the manifest::
173173
use Symfony\Component\Asset\Package;
174174
use Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy;
175175

176-
// The value of $strict can be specific per environment "true" for debugging and "false" for stability.
176+
// The value of $strict can be specific per environment: "true" for debugging and "false" for stability.
177177
$strict = true;
178-
// assumes the JSON file above is called "rev-manifest.json"
179-
$package = new Package(new JsonManifestVersionStrategy(__DIR__.'/rev-manifest.json'), $strict);
178+
$package = new Package(new JsonManifestVersionStrategy(__DIR__.'/manifest.json'), $strict);
180179

181-
echo $package->getUrl('not-found.css');
182-
// error:
180+
echo $package->getUrl('css/other.css');
181+
// error: Asset "css/other.css" not found in manifest "/path/to/manifest.json".
183182

184183
.. versionadded:: 5.2
185184

0 commit comments

Comments
 (0)