This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments