\Smarty_Internal_Runtime_Inheritance

Inheritance Runtime Methods processBlock, endChild, init

Summary

Methods
Properties
Constants
init()
endChild()
instanceBlock()
process()
callChild()
callParent()
callBlock()
$state
$childRoot
$inheritanceLevel
$tplIndex
$sources
$sourceStack
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$state

$state : integer

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

Type

integer

$childRoot

$childRoot : array<mixed,\Smarty_Internal_Block>

Array of root child {block} objects

Type

array<mixed,\Smarty_Internal_Block>

$inheritanceLevel

$inheritanceLevel : integer

inheritance template nesting level

Type

integer

$tplIndex

$tplIndex : integer

inheritance template index

Type

integer

$sources

$sources : array<mixed,\Smarty_Template_Source>

Array of template source objects - key template index

Type

array<mixed,\Smarty_Template_Source>

$sourceStack

$sourceStack : array<mixed,\Smarty_Template_Source>

Stack of source objects while executing block code

Type

array<mixed,\Smarty_Template_Source>

Methods

init()

init(\Smarty_Internal_Template  $tpl, boolean  $initChild, array  $blockNames = array()) 

Initialize inheritance

Parameters

\Smarty_Internal_Template $tpl

template object of caller

boolean $initChild

if true init for child template

array $blockNames

outer level block name

endChild()

endChild(\Smarty_Internal_Template  $tpl, null|string  $template = null, null|string  $uid = null, null|string  $func = null) 

End of child template(s) - if outer level is reached flush output buffer and switch to wait for parent template state

Parameters

\Smarty_Internal_Template $tpl
null|string $template

optinal name of inheritance parent template

null|string $uid

uid of inline template

null|string $func

function call name of inline template

instanceBlock()

instanceBlock(\Smarty_Internal_Template  $tpl,   $className, string  $name, integer|null  $tplIndex = null) 

Smarty_Internal_Block constructor.

  • if outer level {block} of child template ($state == 1) save it as child root block
  • otherwise process inheritance and render

Parameters

\Smarty_Internal_Template $tpl
$className
string $name
integer|null $tplIndex

index of outer level {block} if nested

callParent()

callParent(\Smarty_Internal_Template  $tpl, \Smarty_Internal_Block  $block, null  $name = null) 

Render parent on {$smarty.block.parent} or {block append/prepend} *

Parameters

\Smarty_Internal_Template $tpl
\Smarty_Internal_Block $block
null $name

Throws

\SmartyException