winter/modules/cms/twig/StylesNode.php

33 lines
751 B
PHP
Raw Normal View History

2014-05-14 23:24:20 +10:00
<?php namespace Cms\Twig;
use Twig_Node;
use Twig_Compiler;
/**
* Represents a "styles" node
*
* @package october\cms
* @author Alexey Bobkov, Samuel Georges
*/
class StylesNode extends Twig_Node
{
public function __construct($lineno, $tag = 'styles')
{
parent::__construct([], [], $lineno, $tag);
}
/**
* Compiles the node to PHP.
*
2014-05-17 18:08:01 +02:00
* @param Twig_Compiler $compiler A Twig_Compiler instance
2014-05-14 23:24:20 +10:00
*/
public function compile(Twig_Compiler $compiler)
{
$compiler
->addDebugInfo($this)
->write("echo \$this->env->getExtension('CMS')->assetsFunction('css');\n")
->write("echo \$this->env->getExtension('CMS')->displayBlock('styles');\n")
;
}
2014-10-11 01:42:04 +02:00
}