* 1.2.0
+ * removed the possibility to use the "extends" tag from a block
* added "if" modifier support to "for" loops
* 1.1.2 (2011-07-30)
}
}
+ public function isMainScope()
+ {
+ return 1 === count($this->importedFunctions);
+ }
+
public function pushLocalScope()
{
array_unshift($this->importedFunctions, array());
*/
public function parse(Twig_Token $token)
{
+ if (!$this->parser->isMainScope()) {
+ throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine());
+ }
+
if (null !== $this->parser->getParent()) {
throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine());
}