PEEL Shopping
Open source ecommerce : PEEL Shopping
SandboxedPrint.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) 2010 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 
23 {
24  public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
25  {
26  parent::__construct($expr, $lineno, $tag);
27  }
28 
34  public function compile(Twig_Compiler $compiler)
35  {
36  $compiler
37  ->addDebugInfo($this)
38  ->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(')
39  ->subcompile($this->getNode('expr'))
40  ->raw(");\n")
41  ;
42  }
43 
51  protected function removeNodeFilter($node)
52  {
53  if ($node instanceof Twig_Node_Expression_Filter) {
54  return $this->removeNodeFilter($node->getNode('node'));
55  }
56 
57  return $node;
58  }
59 }
Compiles a node to PHP code.
Definition: Compiler.php:18
Twig_Node_SandboxedPrint adds a check for the __toString() method when the variable is an object and ...
removeNodeFilter($node)
Removes node filters.
$lineno
Definition: Node.php:22
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Definition: Compiler.php:207
__construct(Twig_Node_Expression $expr, $lineno, $tag=null)
Abstract class for all nodes that represents an expression.
Definition: Expression.php:18
getNode($name)
Gets a node by name.
Definition: Node.php:187
Represents a node that outputs an expression.
Definition: Print.php:18
compile(Twig_Compiler $compiler)
Compiles the node to PHP.

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.