winter/modules/cms/twig/StylesNode.php

33 lines
810 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 "styles" node
*
* @package october\cms
* @author Alexey Bobkov, Samuel Georges
*/
class StylesNode extends TwigNode
2014-05-14 23:24:20 +10:00
{
public function __construct($lineno, $tag = 'styles')
{
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')->assetsFunction('css');\n")
->write("echo \$this->env->getExtension('Cms\Twig\Extension')->displayBlock('styles');\n")
2014-05-14 23:24:20 +10:00
;
}
2014-10-11 01:42:04 +02:00
}