8000 Tweaks · symfony/symfony-docs@61906be · GitHub
[go: up one dir, main page]

Skip to content

Commit 61906be

Browse files
committed
Tweaks
1 parent a6e2875 commit 61906be

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

components/asset.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ In those cases, use the
166166
// result: build/css/app.b916426ea1d10021f3f17ce8031f93c2.css
167167

168168
If your JSON file is not on your local filesystem but is accessible over HTTP,
169-
you can use the ...
170-
:class:`Symfony\\Component\\Asset\\VersionStrategy\\RemoteJsonManifestVersionStrategy`
169+
use the :class:`Symfony\\Component\\Asset\\VersionStrategy\\RemoteJsonManifestVersionStrategy`
171170
with the :doc:`HttpClient component </components/http_client>`::
172171

173172
use Symfony\Component\Asset\Package;
@@ -178,6 +177,9 @@ with the :doc:`HttpClient component </components/http_client>`::
178177
$manifestUrl = 'https://cdn.example.com/rev-manifest.json';
179178
$package = new Package(new RemoteJsonManifestVersionStrategy($manifestUrl, $httpClient));
180179

180+
.. versionadded:: 5.1
181+
182+
The ``RemoteJsonManifestVersionStrategy`` was introduced in Symfony 5.1.
181183

182184
Custom Version Strategies
183185
.........................

reference/configuration/framework.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,10 +1927,11 @@ json_manifest_path
19271927

19281928
**type**: ``string`` **default**: ``null``
19291929

1930-
The file path to a ``manifest.json`` file containing an associative array of asset
1931-
names and their respective compiled names. A common cache-busting technique using
1932-
a "manifest" file works by writing out assets with a "hash" appended to their
1933-
file names (e.g. ``main.ae433f1cb.css``) during a front-end compilation routine.
1930+
The file path or absolute URL to a ``manifest.json`` file containing an
1931+
associative array of asset names and their respective compiled names. A common
1932+
cache-busting technique using a "manifest" file works by writing out assets with
1933+
a "hash" appended to their file names (e.g. ``main.ae433f1cb.css``) during a
1934+
front-end compilation routine.
19341935

19351936
.. tip::
19361937

@@ -1951,6 +1952,8 @@ package:
19511952
assets:
19521953
# this manifest is applied to every asset (including packages)
19531954
json_manifest_path: "%kernel.project_dir%/public/build/manifest.json"
1955+
# you can use absolute URLs too and Symfony will download them automatically
1956+
# json_manifest_path: 'https://cdn.example.com/manifest.json'
19541957
packages:
19551958
foo_package:
19561959
# this package uses its own manifest (the default file is ignored)
@@ -1972,6 +1975,8 @@ package:
19721975
<framework:config>
19731976
<!-- this manifest is applied to every asset (including packages) -->
19741977
<framework:assets json-manifest-path="%kernel.project_dir%/public/build/manifest.json">
1978+
<!-- you can use absolute URLs too and Symfony will download them automatically -->
1979+
<!-- <framework:assets json-manifest-path="https://cdn.example.com/manifest.json"> -->
19751980
<!-- this package uses its own manifest (the default file is ignored) -->
19761981
<framework:package
19771982
name="foo_package"
@@ -1991,6 +1996,8 @@ package:
19911996
'assets' => [
19921997
// this manifest is applied to every asset (including packages)
19931998
'json_manifest_path' => '%kernel.project_dir%/public/build/manifest.json',
1999+
// you can use absolute URLs too and Symfony will download them automatically
2000+
// 'json_manifest_path' => 'https://cdn.example.com/manifest.json',
19942001
'packages' => [
19952002
'foo_package' => [
19962003
// this package uses its own manifest (the default file is ignored)
@@ -2004,6 +2011,11 @@ package:
20042011
],
20052012
]);
20062013
2014+
.. versionadded:: 5.1
2015+
2016+
The option to use an absolute URL in ``json_manifest_path`` was introduced
2017+
in Symfony 5.1.
2018+
20072019
.. note::
20082020

20092021
This parameter cannot be set at the same time as ``version`` or ``version_strategy``.

0 commit comments

Comments
 (0)
0