/** * Render parent on {$smarty.block.parent} or {block append/prepend} * * * @param \Smarty_Internal_Template $_smarty_tpl * * @throws \SmartyException */ public function callParent(Smarty_Internal_Template $_smarty_tpl) { if (isset($this->parent)) { $this->parent->callBlock($_smarty_tpl, $this->parent->parent); } else { throw new SmartyException("inheritance: illegal {\$smarty.block.parent} or {block append/prepend} used in parent template '{$_smarty_tpl->ext->_inheritance->compiledFilePath[$this->tplIndex]}' block '{$this->name}'"); } }
/** * @param \Smarty_Internal_Block $block * @param \Smarty_Internal_Template $tpl */ public function callBlock(Smarty_Internal_Block $block, Smarty_Internal_Template $tpl) { $this->sourceStack[] = $tpl->source; $tpl->source = $this->sources[$block->tplIndex]; $block->callBlock($tpl); $tpl->source = array_pop($this->sourceStack); }