diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index fa4ac656134..268566bfbe1 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1094,7 +1094,76 @@ version_strategy **type**: ``string`` **default**: ``null`` The service id of the :doc:`asset version strategy ` -applied to the assets. +applied to the assets. This option can be set globally for all assets and +individually for each asset package: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + assets: + # this strategy is applied to every asset (including packages) + version_strategy: 'app.asset.my_versioning_strategy' + packages: + foo_package: + # this package removes any versioning (its assets won't be versioned) + version: ~ + bar_package: + # this package uses its own strategy (the default strategy is ignored) + version_strategy: 'app.asset.another_version_strategy' + baz_package: + # this package inherits the default strategy + base_path: '/images' + + .. code-block:: xml + + + + + + + + + + + + + + + .. code-block:: php + + // app/config/config.php + $container->loadFromExtension('framework', array( + 'assets' => array( + 'version_strategy' => 'app.asset.my_versioning_strategy', + 'packages' => array( + 'foo_package' => array( + // ... + 'version' => null, + ), + 'bar_package' => array( + // ... + 'version_strategy' => 'app.asset.another_version_strategy', + ), + 'baz_package' => array( + // ... + 'base_path' => '/images', + ), + ), + ), + )); .. note::