Menu

## TemplateManager
in package

TemplateManager.php : 10

### 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

TemplateManager.php : 13
`public static string $defaultTemplateDir = __DIR__ . '/DefaultTemplates/'`

#### $env

TemplateManager.php : 15
`public static Environment|null $env = null`

#### $scope

TemplateManager.php : 16
`public static array<string|int, mixed> $scope = []`

#### $templates

TemplateManager.php : 14
`public static array<string|int, mixed> $templates = []`

### Methods

#### addData()

TemplateManager.php : 28
`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()

TemplateManager.php : 155
`public static exist(mixed $id) : bool`

##### Parameters

$id : mixed

##### Return values

bool —

#### getData()

TemplateManager.php : 62
`public static getData(mixed $key[, mixed $scopeName = "default" ]) : mixed`

##### Parameters

$key : mixed
$scopeName : mixed = "default"

##### Return values

mixed —

#### initDefaultScope()

TemplateManager.php : 18
`public static initDefaultScope([mixed $data = [] ][, mixed $writeover = false ]) : mixed`

##### Parameters

$data : mixed = []
$writeover : mixed = false

##### Return values

mixed —

#### register()

TemplateManager.php : 150
`public static register(Template $template) : mixed`

##### Parameters

$template : Template

##### Return values

mixed —

#### render()

TemplateManager.php : 160
`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()

TemplateManager.php : 175
`public static renderDefaultTemplate(mixed $templateId[, mixed $data = [] ]) : void`

##### Parameters

$templateId : mixed
$data : mixed = []

##### Return values

void —

#### setTwigEnv()

TemplateManager.php : 142

Set twig environment in template manager and loads custom extensions.

`public static setTwigEnv(Environment $env) : mixed`

##### Parameters

$env : Environment

##### Return values

mixed —

#### getArrayByPath()

TemplateManager.php : 78
`private static getArrayByPath(mixed $key, mixed $array) : mixed`

##### Parameters

$key : mixed
$array : mixed

##### Return values

mixed —

#### isPath()

TemplateManager.php : 128
`private static isPath(mixed $key) : mixed`

##### Parameters

$key : mixed

##### Return values

mixed —

#### setArrayByPath()

TemplateManager.php : 99
`private static setArrayByPath(mixed $path, mixed $val, mixed $array) : mixed`

##### Parameters

$path : mixed
$val : mixed
$array : mixed

##### Return values

mixed —

## Search results