class Template

Template.

Constants

LAYER_TOP

LAYER_SNIPPET

LAYER_LOCAL

protected CONTENT_TYPE

protected BLOCKS

Properties

stdClass $global
protected array $params
protected FilterExecutor $filters
protected string|false|null $parentName
protected array[] $varStack

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(int|string $layer = self::LAYER_TOP)

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|null $mod, string|null $block = null)

No description

void
prepare()

No description

array
main()

No description

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

Renders block.

void
renderBlockParent(string $name, array $params)

Renders parent block.

void
addBlock(string $name, string $contentType, array $functions, int|string $layer = null)

Creates block if doesn't exist and checks if content type is the same.

string
capture(callable $function)

Captures output to string.

void
enterBlockLayer(int $staticId, array $vars)

No description

void
copyBlockLayer()

No description

void
leaveBlockLayer()

No description

bool
hasBlock(string $name)

No description

mixed
call(mixed $callable)

No description

mixed
prop(mixed $obj, mixed $prop)

No description

mixed
__get(string $name)

No description

Details

at line 74
__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 94
Engine getEngine()

No description

Return Value

Engine

at line 100
string getName()

No description

Return Value

string

at line 110
array getParameters()

Returns array of all parameters.

Return Value

array

at line 122
mixed getParameter(string $name)

Returns parameter.

Parameters

string $name

Return Value

mixed

at line 135
array getBlockNames(int|string $layer = self::LAYER_TOP)

No description

Parameters

int|string $layer

Return Value

array

at line 141
string getContentType()

No description

Return Value

string

at line 147
string|null getParentName()

No description

Return Value

string|null

at line 153
Template|null getReferringTemplate()

No description

Return Value

Template|null

at line 159
string|null getReferenceType()

No description

Return Value

string|null

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

internal  
 

Renders template.

Parameters

string|null $block

Return Value

void

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

internal  
 

Renders template.

Parameters

string $name
array $params
string $referenceType

Return Value

Template

at line 263
void renderToContentType(string|Closure|null $mod, string|null $block = null)

internal  
 

No description

Parameters

string|Closure|null $mod

content-type name or modifier closure

string|null $block

Return Value

void

at line 275
void prepare()

internal  
 

No description

Return Value

void

at line 284
array main()

internal  
 

No description

Return Value

array

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

internal  
 

Renders block.

Parameters

string $name
array $params
string|Closure|null $mod

content-type name or modifier closure

int|string $layer

Return Value

void

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

internal  
 

Renders parent block.

Parameters

string $name
array $params

Return Value

void

at line 345
protected void addBlock(string $name, string $contentType, array $functions, int|string $layer = null)

internal  
 

Creates block if doesn't exist and checks if content type is the same.

Parameters

string $name
string $contentType
array $functions
int|string $layer

Return Value

void

at line 392
string capture(callable $function)

internal  
 

Captures output to string.

Parameters

callable $function

Return Value

string

at line 419
protected void enterBlockLayer(int $staticId, array $vars)

No description

Parameters

int $staticId
array $vars

Return Value

void

at line 427
protected void copyBlockLayer()

No description

Return Value

void

at line 435
protected void leaveBlockLayer()

No description

Return Value

void

at line 442
bool hasBlock(string $name)

No description

Parameters

string $name

Return Value

bool

at line 456
protected mixed call(mixed $callable)

internal  
 

No description

Parameters

mixed $callable

Return Value

mixed

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

internal  
 

No description

Parameters

mixed $obj
mixed $prop

Return Value

mixed

at line 502
mixed __get(string $name)

No description

Parameters

string $name

Return Value

mixed

Traits

Better OOP experience.