@@ -991,40 +991,43 @@ assets won't be cached when deployed. For example, ``/images/logo.png`` might
991
991
look like ``/images/logo.png?v2 ``. For more information, see the :ref: `ref-framework-assets-version `
992
992
configuration option.
993
993
994
+ .. _`
995
+
994
996
.. versionadded :: 2.5
995
- Absolute URLs for assets were introduced in Symfony 2.5.
997
+ Setting versioned URLs on an asset-by-asset basis were introduced in Symfony 2.5.
996
998
997
- If you need absolute URLs for assets , you can set the third argument (or the
998
- `` absolute `` argument) to `` true `` :
999
+ If you need to set a version for a specific asset , you can set the fourth
1000
+ argument (or the `` version `` argument) to the desired version :
999
1001
1000
1002
.. configuration-block ::
1001
1003
1002
1004
.. code-block :: html+jinja
1003
1005
1004
- <img src="{{ asset('images/logo.png', absolute=true ) }}" alt="Symfony!" />
1006
+ <img src="{{ asset('images/logo.png', version=3.0 ) }}" alt="Symfony!" />
1005
1007
1006
1008
.. code-block :: html+php
1007
1009
1008
- <img src="<?php echo $view['assets']->getUrl('images/logo.png', null, true) ?>" alt="Symfony!" />
1010
+ <img src="<?php echo $view['assets']->getUrl('images/logo.png', null, false, '3.0') ?>" alt="Symfony!" />
1011
+
1012
+ If you dont give a version or pass ``null ``, the default package version
1013
+ (from :ref: `ref-framework-assets-version `) wil be used. If you pass ``false ``,
1014
+ versioned URL will be deactivated for this asset.
1009
1015
1010
1016
.. versionadded :: 2.5
1011
- Versioned URLs for assets were introduced in Symfony 2.5.
1017
+ Absolute URLs for assets were introduced in Symfony 2.5.
1012
1018
1013
- If you need versioned URLs for assets, you can set the fourth argument (or the
1014
- ``version `` argument) to the desired version :
1019
+ If you need absolute URLs for assets, you can set the third argument (or the
1020
+ ``absolute `` argument) to `` true `` :
1015
1021
1016
1022
.. configuration-block ::
1017
1023
1018
1024
.. code-block :: html+jinja
1019
1025
1020
- <img src="{{ asset('images/logo.png', version=3.0 ) }}" alt="Symfony!" />
1026
+ <img src="{{ asset('images/logo.png', absolute=true ) }}" alt="Symfony!" />
1021
1027
1022
1028
.. code-block :: html+php
1023
1029
1024
- <img src="<?php echo $view['assets']->getUrl('images/logo.png', null, false, '3.0') ?>" alt="Symfony!" />
1025
-
1026
- If you dont give a version or pass ``null ``, the default package version will
1027
- be used. If you pass ``false ``, versioned URL will be deactivated.
1030
+ <img src="<?php echo $view['assets']->getUrl('images/logo.png', null, true) ?>" alt="Symfony!" />
1028
1031
1029
1032
.. index ::
1030
1033
single: Templating; Including stylesheets and JavaScripts
0 commit comments