class Template

Template.

Constants

LayerTop

LayerSnippet

LayerLocal

ContentType

Source

Blocks

Properties

$global

global accumulators for intermediate results

protected array $params
protected $filters
protected internal $parentName
protected array[] $varStack
protected Block[][] $blocks

Methods

__construct(Engine $engine, array $params, FilterExecutor $filters, stdClass $providers, string $name)

No description

getEngine()

No description

string
getName()

No description

array
getParameters()

Returns array of all parameters.

array
getBlockNames(int|string $layer = self::LayerTop)

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

array
prepare()

No description

void
main(array $params)

No description

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

Renders block.

void
renderBlockParent(string $name, array $params)

Renders parent block.

void
addBlock(string $name, string $contentType, array $functions, int|string|null $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

Details

at line 62
__construct(Engine $engine, array $params, FilterExecutor $filters, stdClass $providers, string $name)

No description

Parameters

Engine $engine
array $params
FilterExecutor $filters
stdClass $providers
string $name

at line 80
Engine getEngine()

No description

Return Value

Engine

at line 86
string getName()

No description

Return Value

string

at line 96
array getParameters()

Returns array of all parameters.

Return Value

array

at line 105
array getBlockNames(int|string $layer = self::LayerTop)

No description

Parameters

int|string $layer

Return Value

array

at line 111
string|null getParentName()

No description

Return Value

string|null

at line 117
Template|null getReferringTemplate()

No description

Return Value

Template|null

at line 123
string|null getReferenceType()

No description

Return Value

string|null

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

internal  
 

Renders template.

Parameters

string|null $block

Return Value

void

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

internal  
 

Renders template.

Parameters

string $name
array $params
string $referenceType

Return Value

Template

at line 198
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 210
array prepare()

No description

Return Value

array

at line 217
void main(array $params)

No description

Parameters

array $params

Return Value

void

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

internal  
 

Renders block.

Parameters

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

content-type name or modifier closure

int|string|null $layer

Return Value

void

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

internal  
 

Renders parent block.

Parameters

string $name
array $params

Return Value

void

at line 280
protected void addBlock(string $name, string $contentType, array $functions, int|string|null $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|null $layer

Return Value

void

at line 332
string capture(callable $function)

internal  
 

Captures output to string.

Parameters

callable $function

Return Value

string

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

No description

Parameters

int $staticId
array $vars

Return Value

void

at line 364
protected void copyBlockLayer()

No description

Return Value

void

at line 372
protected void leaveBlockLayer()

No description

Return Value

void

at line 379
bool hasBlock(string $name)

No description

Parameters

string $name

Return Value

bool