TemplateManager
in package
Table of Contents
- $defaultTemplateDir : string
- $env : Environment|null
- $scope : array<string|int, mixed>
- $templates : array<string|int, mixed>
- addData() : mixed
- exist() : bool
- getData() : mixed
- initDefaultScope() : mixed
- register() : mixed
- render() : mixed
- renderDefaultTemplate() : void
- setTwigEnv() : mixed
- Set twig environment in template manager and loads custom extensions.
- getArrayByPath() : mixed
- isPath() : mixed
- setArrayByPath() : mixed
Properties
$defaultTemplateDir
public
static string
$defaultTemplateDir
= __DIR__ . '/DefaultTemplates/'
$env
public
static Environment|null
$env
= null
$scope
public
static array<string|int, mixed>
$scope
= []
$templates
public
static array<string|int, mixed>
$templates
= []
Methods
addData()
public
static addData(mixed $key, mixed $value[, mixed $writeover = false ][, mixed $scopeName = "default" ]) : mixed
Parameters
- $key : mixed
- $value : mixed
- $writeover : mixed = false
- $scopeName : mixed = "default"
Return values
mixed —exist()
public
static exist(mixed $id) : bool
Parameters
- $id : mixed
Return values
bool —getData()
public
static getData(mixed $key[, mixed $scopeName = "default" ]) : mixed
Parameters
- $key : mixed
- $scopeName : mixed = "default"
Return values
mixed —initDefaultScope()
public
static initDefaultScope([mixed $data = [] ][, mixed $writeover = false ]) : mixed
Parameters
- $data : mixed = []
- $writeover : mixed = false
Return values
mixed —register()
public
static register(Template $template) : mixed
Parameters
- $template : Template
Return values
mixed —render()
public
static render(string $templateId[, array<string|int, mixed> $data = [] ][, string $scope = "default" ][, Environment $env = null ]) : mixed
Parameters
- $templateId : string
- $data : array<string|int, mixed> = []
- $scope : string = "default"
- $env : Environment = null
Return values
mixed —renderDefaultTemplate()
public
static renderDefaultTemplate(mixed $templateId[, mixed $data = [] ]) : void
Parameters
- $templateId : mixed
- $data : mixed = []
Return values
void —setTwigEnv()
Set twig environment in template manager and loads custom extensions.
public
static setTwigEnv(Environment $env) : mixed
Parameters
- $env : Environment
Return values
mixed —getArrayByPath()
private
static getArrayByPath(mixed $key, mixed $array) : mixed
Parameters
- $key : mixed
- $array : mixed
Return values
mixed —isPath()
private
static isPath(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —setArrayByPath()
private
static setArrayByPath(mixed $path, mixed $val, mixed $array) : mixed
Parameters
- $path : mixed
- $val : mixed
- $array : mixed