Skip to content
Myr

Docs for layout option

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent d9d30ab · Browse files · 1 file+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−0 removed

  • other:+12 added−0 removed

1 file+12 added−0 removed

modified:docs/guide.md+12 added
344 unmodified lines
345Which can then be overridden within the `res.render()` call if need be:346347 res.render('myview.ejs', { layout: true });348349When an alternate layout is required, we may also specify a path. For example if we have _view engine_ set to _jade_ and a file named _./views/mylayout.jade_ we can simply pass:350351 res.render('page', { layout: 'mylayout' });352353Otherwise we must specify the extension:354355 res.render('page', { layout: 'mylayout.jade' });356357These paths may also be absolute:358359 res.render('page', { layout: __dirname + '/../../mylayout.jade' });360361A good example of this is specifying custom _ejs_ opening and closing tags:362363 app.set('view options', {364 open: '{{',
438 unmodified lines