PEEL Shopping
Open source ecommerce : PEEL Shopping
Extends.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) 2009 Fabien Potencier
7  * (c) 2009 Armin Ronacher
8  *
9  * For the full copyright and license information, please view the LICENSE
10  * file that was distributed with this source code.
11  */
12 
21 {
29  public function parse(Twig_Token $token)
30  {
31  if (!$this->parser->isMainScope()) {
32  throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename());
33  }
34 
35  if (null !== $this->parser->getParent()) {
36  throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename());
37  }
38  $this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
39 
40  $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
41  }
42 
48  public function getTag()
49  {
50  return 'extends';
51  }
52 }
Base class for all token parsers.
Definition: TokenParser.php:17
Exception thrown when a syntax error occurs during lexing or parsing of a template.
Definition: Syntax.php:18
parse(Twig_Token $token)
Parses a token and returns a node.
Definition: Extends.php:29
Extends a template by another one.
Definition: Extends.php:20
getTag()
Gets the tag name associated with this token parser.
Definition: Extends.php:48
const BLOCK_END_TYPE
Definition: Token.php:28
Represents a Token.
Definition: Token.php:18
getLine()
Gets the line.
Definition: Token.php:94

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:19 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.