TemplateEngine
in package
Provides support for pure and secure PHP templates
Table of Contents
- __construct() : mixed
- apply() : string|FileNotFound|BindFailed
- Returns the content string
- render() : bool|FileNotFound|BindFailed
- Displays the content
Methods
__construct()
public
__construct([TemplatingStrategyInterface $renderingAlgoFactory = new StreamContentStrategy() ][, Binder $binder = new Binder() ][, Dispatcher $dispatcher = new Dispatcher() ]) : mixed
Parameters
- $renderingAlgoFactory : TemplatingStrategyInterface = new StreamContentStrategy()
- $binder : Binder = new Binder()
- $dispatcher : Dispatcher = new Dispatcher()
Return values
mixed —apply()
Returns the content string
public
apply(string $givenPath[, HtmlSafeContext|null $context = null ]) : string|FileNotFound|BindFailed
Parameters
- $givenPath : string
- $context : HtmlSafeContext|null = null
Return values
string|FileNotFound|BindFailed —render()
Displays the content
public
render(string $pathToTemplate, HtmlSafeContext $context) : bool|FileNotFound|BindFailed
Parameters
- $pathToTemplate : string
- $context : HtmlSafeContext