PEEL Shopping
Open source ecommerce : PEEL Shopping
Import.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  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
20 {
28  public function parse(Twig_Token $token)
29  {
30  $macro = $this->parser->getExpressionParser()->parseExpression();
31  $this->parser->getStream()->expect('as');
32  $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine());
33  $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
34 
35  $this->parser->addImportedSymbol('template', $var->getAttribute('name'));
36 
37  return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag());
38  }
39 
45  public function getTag()
46  {
47  return 'import';
48  }
49 }
Base class for all token parsers.
Definition: TokenParser.php:17
getTag()
Gets the tag name associated with this token parser.
Definition: Import.php:45
Imports macros.
Definition: Import.php:19
Represents an import node.
Definition: Import.php:17
const BLOCK_END_TYPE
Definition: Token.php:28
Represents a Token.
Definition: Token.php:18
parse(Twig_Token $token)
Parses a token and returns a node.
Definition: Import.php:28
const NAME_TYPE
Definition: Token.php:30
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.