class Template

Template.

Properties

stdClass $global
protected string $contentType
protected array $params
protected FilterExecutor $filters
protected array $blocks
protected string|false|null $parentName
protected array $blockQueue
protected array $blockTypes

Methods

__construct(Engine $engine, array $params, FilterExecutor $filters, array $providers, string $name, Policy|null $policy)

No description

getEngine()

No description

string
getName()

No description

array
getParameters()

Returns array of all parameters.

mixed
getParameter(string $name)

Returns parameter.

array
getBlockNames()

No description

string
getContentType()

No description

string|null
getParentName()

No description

Template|null
getReferringTemplate()

No description

string|null
getReferenceType()

No description

void
render(string|null $block = null)

Renders template.

createTemplate(string $name, array $params, string $referenceType)

Renders template.

void
renderToContentType(string|Closure $mod)

No description

void
prepare()

No description

array
main()

No description

void
renderBlock(string $name, array $params, string|Closure $mod = null)

Renders block.

void
renderBlockParent(string $name, array $params)

Renders parent block.

void
checkBlockContentType(string $current, string $name)

No description

string
capture(callable $function)

Captures output to string.

mixed
call(mixed $callable)

No description

mixed
prop(mixed $obj, mixed $prop)

No description

Details

at line 68
__construct(Engine $engine, array $params, FilterExecutor $filters, array $providers, string $name, Policy|null $policy)

No description

Parameters

Engine $engine
array $params
FilterExecutor $filters
array $providers
string $name
Policy|null $policy

at line 88
Engine getEngine()

No description

Return Value

Engine

at line 94
string getName()

No description

Return Value

string

at line 104
array getParameters()

Returns array of all parameters.

Return Value

array

at line 114
mixed getParameter(string $name)

Returns parameter.

Parameters

string $name

Return Value

mixed

at line 123
array getBlockNames()

No description

Return Value

array

at line 129
string getContentType()

No description

Return Value

string

at line 135
string|null getParentName()

No description

Return Value

string|null

at line 141
Template|null getReferringTemplate()

No description

Return Value

Template|null

at line 147
string|null getReferenceType()

No description

Return Value

string|null

at line 157
void render(string|null $block = null)

internal  
 

Renders template.

Parameters

string|null $block

Return Value

void

at line 208
Template createTemplate(string $name, array $params, string $referenceType)

internal  
 

Renders template.

Parameters

string $name
array $params
string $referenceType

Return Value

Template

at line 236
void renderToContentType(string|Closure $mod)

internal  
 

No description

Parameters

string|Closure $mod

content-type name or modifier closure

Return Value

void

at line 258
void prepare()

internal  
 

No description

Return Value

void

at line 267
array main()

internal  
 

No description

Return Value

array

at line 282
void renderBlock(string $name, array $params, string|Closure $mod = null)

internal  
 

Renders block.

Parameters

string $name
array $params
string|Closure $mod

content-type name or modifier closure

Return Value

void

at line 312
void renderBlockParent(string $name, array $params)

internal  
 

Renders parent block.

Parameters

string $name
array $params

Return Value

void

at line 323
protected void checkBlockContentType(string $current, string $name)

internal  
 

No description

Parameters

string $current
string $name

Return Value

void

at line 343
string capture(callable $function)

internal  
 

Captures output to string.

Parameters

callable $function

Return Value

string

at line 367
protected mixed call(mixed $callable)

internal  
 

No description

Parameters

mixed $callable

Return Value

mixed

at line 400
protected mixed prop(mixed $obj, mixed $prop)

internal  
 

No description

Parameters

mixed $obj
mixed $prop

Return Value

mixed

Traits

Better OOP experience.