Re: [HTML_Template_Sigma] Behaviour of global variables

From: Date: Mon, 10 Mar 2008 16:24:18 +0000
Subject: Re: [HTML_Template_Sigma] Behaviour of global variables
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28626@lists.php.net to get a copy of this message
Markus Ernst schrieb: [...]
I actually see 2 possible improvements that could make handling this kind of things easier: [...]
2. Add method to detect a parent block of a placeholder A new method getParentBlock(string $child) is introduced; $child is the name of the placeholder or block that is to be checked for a parent. It might be useful to return false if the parent is __global__: if ($output = $cache->get('page_contents')) { $tpl->setGlobalVariable('page_contents', $output); if ($parent_block = $tpl->getParentBlock('page_contents')) {
    $tpl->parse($parent_block);
I am sorry, this is of course: $tpl->touchBlock($parent_block);
} }


« previous php.pear.general (#28626) next »