From 5f431ef6b09643976404d00f95a52bf50733cf78 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Feb 2017 12:35:45 +0100 Subject: [PATCH 1/3] Improved the explanation of "version_strategy" option --- reference/configuration/framework.rst | 57 ++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index fa4ac656134..237efafbfb0 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1093,8 +1093,61 @@ version_strategy **type**: ``string`` **default**: ``null`` -The service id of the :doc:`asset version strategy ` -applied to the assets. +The service id of the asset version strategy applied to the assets. In addition +to your own :doc:`custom asset version strategies `, +Symfony defines two services for its :ref:`built-in strategies `: +``assets.empty_version_strategy`` and ``assets.static_version_strategy``. + +The ``assets.empty_version_strategy`` is useful to override the global asset +versioning strategy inside an 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: + # ... except if a package explicitly uses the empty strategy + version_strategy: 'assets.empty_version_strategy' + + .. 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_strategy' => 'assets.empty_version_strategy', + ), + ), + ), + )); .. note:: From 029be56c0cdf4bb6fb0c3b3e02e3062301b5ef10 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Feb 2017 21:44:40 +0100 Subject: [PATCH 2/3] Reworded everything --- reference/configuration/framework.rst | 30 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 237efafbfb0..672f6ae9ab7 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1093,13 +1093,9 @@ version_strategy **type**: ``string`` **default**: ``null`` -The service id of the asset version strategy applied to the assets. In addition -to your own :doc:`custom asset version strategies `, -Symfony defines two services for its :ref:`built-in strategies `: -``assets.empty_version_strategy`` and ``assets.static_version_strategy``. - -The ``assets.empty_version_strategy`` is useful to override the global asset -versioning strategy inside an asset package: +The service id of the :doc:`asset version strategy ` +applied to the assets. This option can be set globally for all assets and +individually for each asset package: .. configuration-block:: @@ -1108,12 +1104,15 @@ versioning strategy inside an asset package: # app/config/config.yml framework: assets: - # this strategy is applied to every asset (including packages) ... + # this strategy is applied to every asset (including packages) version_strategy: 'app.asset.my_versioning_strategy' packages: foo_package: - # ... except if a package explicitly uses the empty strategy - version_strategy: 'assets.empty_version_strategy' + # this makes the assets of this package to not be versioned + version: ~ + bar_package: + # this package doesn't use the global versioning strategy + version_strategy: 'app.asset.another_version_strategy' .. code-block:: xml @@ -1129,7 +1128,10 @@ versioning strategy inside an asset package: + version="null" /> + @@ -1143,7 +1145,11 @@ versioning strategy inside an asset package: 'packages' => array( 'foo_package' => array( // ... - 'version_strategy' => 'assets.empty_version_strategy', + 'version' => null, + ), + 'bar_package' => array( + // ... + 'version_strategy' => 'app.asset.another_version_strategy', ), ), ), From 7b09de088c74d132a12c74f6274b39c277a32a38 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 15 Apr 2017 11:57:37 +0200 Subject: [PATCH 3/3] Added another example showing how the version strategy is inherited --- reference/configuration/framework.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 672f6ae9ab7..268566bfbe1 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1108,11 +1108,14 @@ individually for each asset package: version_strategy: 'app.asset.my_versioning_strategy' packages: foo_package: - # this makes the assets of this package to not be versioned + # this package removes any versioning (its assets won't be versioned) version: ~ bar_package: - # this package doesn't use the global versioning strategy + # 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 @@ -1132,6 +1135,9 @@ individually for each asset package: + @@ -1151,6 +1157,10 @@ individually for each asset package: // ... 'version_strategy' => 'app.asset.another_version_strategy', ), + 'baz_package' => array( + // ... + 'base_path' => '/images', + ), ), ), )); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy