Engine
Description
The engine
function allows you to specify the engine used to render view
and content templates. You can also specify a third-party engine to use, such as EPS.
If you don't use the
engine
function, then the defaut of HTML will be used
Examples
The following example will render views and content using the Pode template engine (such as the
index.pode
view or thestyle.css.pode
public content file):Server { engine pode }
The following example will use the third-party engine
EPS
to render views (such as theindex.eps
view or thestyle.css.eps
public content file):Server { engine eps { param($path, $data) return Invoke-EpsTemplate -Path $path -Binding $data } }
Parameters
Name
Type
Required
Description
Default
Engine
string
true
The type of engine to use, can be either HTML, Pode, or a custom third-party type - the value passed should be the extension used by the engine
HTML
ScriptBlock
scriptblock
false
When using a third-party template engine, the ScriptBlock is required as it tells Pode how to render views/static content using the engine
null
Last updated