winter/modules/cms/twig/PageNode.php

32 lines
692 B
PHP
Raw Normal View History

2014-05-14 23:24:20 +10:00
<?php namespace Cms\Twig;
use Twig\Node\Node as TwigNode;
use Twig\Compiler as TwigCompiler;
2014-05-14 23:24:20 +10:00
/**
* Represents a page node
*
* @package october\cms
* @author Alexey Bobkov, Samuel Georges
*/
class PageNode extends TwigNode
2014-05-14 23:24:20 +10:00
{
public function __construct($lineno, $tag = 'page')
{
parent::__construct([], [], $lineno, $tag);
}
/**
* Compiles the node to PHP.
*
* @param TwigCompiler $compiler A TwigCompiler instance
2014-05-14 23:24:20 +10:00
*/
public function compile(TwigCompiler $compiler)
2014-05-14 23:24:20 +10:00
{
$compiler
->addDebugInfo($this)
2017-05-13 09:34:20 +10:00
->write("echo \$this->env->getExtension('Cms\Twig\Extension')->pageFunction();\n")
2014-05-14 23:24:20 +10:00
;
}
2014-10-11 01:42:04 +02:00
}