Skip to content

Commit 5d9fb5a

Browse files
Merge remote-tracking branch 'origin/master' into develop
2 parents c47dc45 + 3099fd8 commit 5d9fb5a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ Loads a layout partial of a given name and defines block content.
2828
{{/extend}}
2929
```
3030

31+
The `{{#extend}}` helper allows you to reason about your layouts as you would class extension where the above is equivalent to the following psuedo code:
32+
33+
```js
34+
class Page extends Layout {
35+
title() {
36+
return 'Example - ' + super();
37+
}
38+
}
39+
```
40+
3141
### `{{#embed [partial]}}`
3242

3343
- `partial` `String` - Name of partial to render.
@@ -54,6 +64,23 @@ Allows you to load a partial which itself extends from a layout. Blocks defined
5464
{{/extend}}
5565
```
5666

67+
The `{{#embed}}` helper allows you to reason about your partials as you would class instantiation where the above is equivalent to the following psuedo code:
68+
69+
```js
70+
class Page extends Layout {
71+
body() {
72+
var gallery = new Gallery();
73+
gallery.replaceBody('<img src="1.png" alt="" />\n<img src="2.png" alt="" />');
74+
75+
var modal = new Modal();
76+
modal.prependTitle('Image 1 - ');
77+
modal.replaceBody('<img src="1.png" alt="" />');
78+
79+
return gallery.toString() + modal.toString();
80+
}
81+
}
82+
```
83+
5784
### `{{#block [name]}}`
5885

5986
- `name` `String` - Block identifier.

0 commit comments

Comments
 (0)