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

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)

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 71
__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 91
Engine getEngine()

No description

Return Value

Engine

at line 97
string getName()

No description

Return Value

string

at line 107
array getParameters()

Returns array of all parameters.

Return Value

array

at line 117
mixed getParameter(string $name)

Returns parameter.

Parameters

string $name

Return Value

mixed

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

No description

Parameters

int|string $layer

Return Value

array

at line 136
string getContentType()

No description

Return Value

string

at line 142
string|null getParentName()

No description

Return Value

string|null

at line 148
Template|null getReferringTemplate()

No description

Return Value

Template|null

at line 154
string|null getReferenceType()

No description

Return Value

string|null

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

internal  
 

Renders template.

Parameters

string|null $block

Return Value

void

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

internal  
 

Renders template.

Parameters

string $name
array $params
string $referenceType

Return Value

Template

at line 243
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 255
void prepare()

internal  
 

No description

Return Value

void

at line 264
array main()

internal  
 

No description

Return Value

array

at line 280
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 308
void renderBlockParent(string $name, array $params)

internal  
 

Renders parent block.

Parameters

string $name
array $params

Return Value

void

at line 325
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 372
string capture(callable $function)

internal  
 

Captures output to string.

Parameters

callable $function

Return Value

string

at line 402
protected void enterBlockLayer(int $staticId)

No description

Parameters

int $staticId

Return Value

void

at line 409
protected void leaveBlockLayer()

No description

Return Value

void

at line 415
bool hasBlock(string $name)

No description

Parameters

string $name

Return Value

bool

at line 429
protected mixed call(mixed $callable)

internal  
 

No description

Parameters

mixed $callable

Return Value

mixed

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

internal  
 

No description

Parameters

mixed $obj
mixed $prop

Return Value

mixed

at line 475
mixed __get(string $name)

No description

Parameters

string $name

Return Value

mixed

Traits

Better OOP experience.