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 +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -117,3 +117,38 @@ class Module
117
117
118
118
> More informations on registering module-specific listeners can be found in the
119
119
> [ documentation of zend-mvc] ( https://docs.zendframework.com/zend-mvc/examples/#registering-module-specific-listeners ) .
120
+
121
+ ## Add Template Scripts to the Configuration
122
+
123
+ Extend the configuration of a module to add the specific layout script, e.g.
124
+ ` module/Admin/config/module.config.php ` :
125
+
126
+ ``` php
127
+ return [
128
+ // Add the following array
129
+ 'view_manager' => [
130
+ 'template_map' => [
131
+ 'layout/admin' => __DIR__ . '/../view/layout/admin.phtml',
132
+ ],
133
+ ],
134
+ // …
135
+ ];
136
+ ```
137
+
138
+ And in another module, e.g. ` module/Album/config/module.config.php ` :
139
+
140
+ ``` php
141
+ return [
142
+ // Add the following array
143
+ 'view_manager' => [
144
+ 'template_map' => [
145
+ 'layout/album' => __DIR__ . '/../view/layout/layout-of-album.phtml',
146
+ ],
147
+ ],
148
+ // …
149
+ ];
150
+ ```
151
+
152
+ The name of the array key must follow the format ` layout/{module-name} ` and the
153
+ value must contain the path to the layout file. The path and the filename can be
154
+ freely chosen.
You can’t perform that action at this time.
0 commit comments