File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -134,11 +134,30 @@ asset_version
134
134
135
135
.. code-block :: twig
136
136
137
- {{ asset_version(packageName = null) }}
137
+ {{ asset_version(path, packageName = null) }}
138
138
139
+ ``path ``
140
+ **type **: ``string ``
139
141
``packageName `` *(optional) *
140
142
**type **: ``string `` | ``null `` **default **: ``null ``
141
143
144
+ .. code-block :: yaml
145
+
146
+ # config/packages/framework.yaml
147
+ framework :
148
+ # ...
149
+ assets :
150
+ packages :
151
+ foo_package :
152
+ base_path : /avatars
153
+ version : ' v2.0'
154
+
155
+ .. code-block :: twig
156
+
157
+ {# the image lives at "public/avatars/" #}
158
+ {{ asset_version(path = 'avatar.png', packageName = 'foo_package') }}
159
+ {# output: v2.0 #}
160
+
142
161
Returns the current version of the package, more information in
143
162
:ref: `templates-link-to-assets `.
144
163
You can’t perform that action at this time.
0 commit comments