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

Commit 316e20d

Browse files
committed
Adds section for template script configuration
1 parent 30946b5 commit 316e20d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/book/cookbook/setting-module-specific-layouts.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,38 @@ class Module
117117

118118
> More informations on registering module-specific listeners can be found in the
119119
> [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.

0 commit comments

Comments
 (0)