Smarty_Internal_Runtime_Inheritance
Inheritance Runtime Methods processBlock, endChild, init
- Full name:
\Smarty_Internal_Runtime_Inheritance
Properties
state
State machine - 0 idle next extends will create a new inheritance tree - 1 processing child template - 2 wait for next inheritance template - 3 assume parent template, if child will loaded goto state 1 a call to a sub template resets the state to 0
childRoot
Array of root child {block} objects
inheritanceLevel
inheritance template nesting level
tplIndex
inheritance template index
sources
Array of template source objects
sourceStack
Stack of source objects while executing block code
Methods
init
Initialize inheritance
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | template object of caller |
$initChild |
bool | if true init for child template |
$blockNames |
array | outer level block name |
endChild
End of child template(s) - if outer level is reached flush output buffer and switch to wait for parent template state
public endChild(\Smarty_Internal_Template $tpl, null|string $template = null, null|string $uid = null, null|string $func = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | |
$template |
null|string | optional name of inheritance parent template |
$uid |
null|string | uid of inline template |
$func |
null|string | function call name of inline template |
Throws:
instanceBlock
Smarty_Internal_Block constructor.
public instanceBlock(\Smarty_Internal_Template $tpl, mixed $className, string $name, int|null $tplIndex = null): mixed
- if outer level {block} of child template ($state === 1) save it as child root block
- otherwise process inheritance and render
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | |
$className |
mixed | |
$name |
string | |
$tplIndex |
int|null | index of outer level {block} if nested |
Throws:
process
Goto child block or render this
public process(\Smarty_Internal_Template $tpl, \Smarty_Internal_Block $block, \Smarty_Internal_Block|null $parent = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | |
$block |
\Smarty_Internal_Block | |
$parent |
\Smarty_Internal_Block|null |
Throws:
callChild
Render child on \$smarty.block.child
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | |
$block |
\Smarty_Internal_Block |
Return Value:
block content
Throws:
callParent
Render parent block on \$smarty.block.parent or {block append/prepend}
public callParent(\Smarty_Internal_Template $tpl, \Smarty_Internal_Block $block, string $tag): null|string
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl |
\Smarty_Internal_Template | |
$block |
\Smarty_Internal_Block | |
$tag |
string |
Return Value:
block content
Throws:
callBlock
render block
Parameters:
Parameter | Type | Description |
---|---|---|
$block |
\Smarty_Internal_Block | |
$tpl |
\Smarty_Internal_Template |
Automatically generated on 2025-03-18