@@ -1093,13 +1093,9 @@ version_strategy
1093
1093
1094
1094
**type **: ``string `` **default **: ``null ``
1095
1095
1096
- The service id of the asset version strategy applied to the assets. In addition
1097
- to your own :doc: `custom asset version strategies </frontend/custom_version_strategy >`,
1098
- Symfony defines two services for its :ref: `built-in strategies <component-assets-versioning >`:
1099
- ``assets.empty_version_strategy `` and ``assets.static_version_strategy ``.
1100
-
1101
- The ``assets.empty_version_strategy `` is useful to override the global asset
1102
- versioning strategy inside an asset package:
1096
+ The service id of the :doc: `asset version strategy </frontend/custom_version_strategy >`
1097
+ applied to the assets. This option can be set globally for all assets and
1098
+ individually for each asset package:
1103
1099
1104
1100
.. configuration-block ::
1105
1101
@@ -1108,12 +1104,15 @@ versioning strategy inside an asset package:
1108
1104
# app/config/config.yml
1109
1105
framework :
1110
1106
assets :
1111
- # this strategy is applied to every asset (including packages) ...
1107
+ # this strategy is applied to every asset (including packages)
1112
1108
version_strategy : ' app.asset.my_versioning_strategy'
1113
1109
packages :
1114
1110
foo_package :
1115
- # ... except if a package explicitly uses the empty strategy
1116
- version_strategy : ' assets.empty_version_strategy'
1111
+ # this makes the assets of this package to not be versioned
1112
+ version : ~
1113
+ bar_package :
1114
+ # this package doesn't use the global versioning strategy
1115
+ version_strategy : ' app.asset.another_version_strategy'
1117
1116
1118
1117
.. code-block :: xml
1119
1118
@@ -1129,7 +1128,10 @@ versioning strategy inside an asset package:
1129
1128
<framework : assets version_strategy =" app.asset.my_versioning_strategy" >
1130
1129
<framework : package
1131
1130
name =" foo_package"
1132
- version-strategy =" assets.empty_version_strategy" />
1131
+ version =" null" />
1132
+ <framework : package
1133
+ name =" bar_package"
1134
+ version-strategy =" app.asset.another_version_strategy" />
1133
1135
</framework : assets >
1134
1136
</framework : config >
1135
1137
</container >
@@ -1143,7 +1145,11 @@ versioning strategy inside an asset package:
1143
1145
'packages' => array(
1144
1146
'foo_package' => array(
1145
1147
// ...
1146
- 'version_strategy' => 'assets.empty_version_strategy',
1148
+ 'version' => null,
1149
+ ),
1150
+ 'bar_package' => array(
1151
+ // ...
1152
+ 'version_strategy' => 'app.asset.another_version_strategy',
1147
1153
),
1148
1154
),
1149
1155
),
0 commit comments