2014-05-14 23:24:20 +10:00
|
|
|
<?php namespace Cms\Twig;
|
|
|
|
|
2019-03-27 13:15:17 -06:00
|
|
|
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
|
|
|
|
*/
|
2019-03-27 13:15:17 -06:00
|
|
|
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.
|
|
|
|
*
|
2019-03-27 13:15:17 -06:00
|
|
|
* @param TwigCompiler $compiler A TwigCompiler instance
|
2014-05-14 23:24:20 +10:00
|
|
|
*/
|
2019-03-27 13:15:17 -06: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
|
|
|
}
|