Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 570a26d

Browse files
committed
Added CHANGELOG for #64
1 parent 64f8381 commit 570a26d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ All notable changes to this project will be documented in this file, in reverse
1414
`HeadScript`, `HeadLink`, and `InlineScript` view helpers to whitelist the
1515
`crossorigin` and `integrity` attributes as optional attributes.
1616

17+
- [#64](https://github.com/zendframework/zend-view/pull/64) adds a new `Asset`
18+
view helper. This helper uses the following configuration to map a named asset
19+
to the actual file to serve:
20+
21+
```php
22+
'view_helper_config' => [
23+
'asset' => [
24+
'resource_map' => [
25+
'css/style.css' => 'css/style-3a97ff4ee3.css',
26+
'js/vendor.js' => 'js/vendor-a507086eba.js',
27+
],
28+
],
29+
],
30+
```
31+
32+
This can also be automated via tools such as gulp-rev and grunt-rev by using
33+
the `rev-manifest.json` each creates directly within your configuration:
34+
35+
```php
36+
'view_helper_config' => [
37+
'asset' => [
38+
'resource_map' => json_decode(file_get_contents('path/to/rev-manifest.json'), true),
39+
],
40+
],
41+
```
42+
43+
The benefit of this approach is that it allows your view scripts to reference
44+
a static asset name, while integrating with your JS and CSS build tools.
45+
1746
### Deprecated
1847

1948
- Nothing.

0 commit comments

Comments
 (0)