<?php
namespace Claromentis\Core\Twig;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array();
use Claromentis\Core\Application;
use Claromentis\Core\Templater\Plugin\TemplaterComponent;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;




abstract class TwigComponent implements TemplaterComponent
{
    
    
    
    
    protected $twig;
    
    
    
    
    protected $dispatcher;
    
    
    
    
    
    
    
    public function __construct(Environment $_6b67522fca36b32553cd09de29b97ff8, EventDispatcherInterface $_b497ce6f2af10f67516aed0ecf34d8cf)
    {
        $this->twig = $_6b67522fca36b32553cd09de29b97ff8;
        $this->dispatcher = $_b497ce6f2af10f67516aed0ecf34d8cf;
    }
    public abstract function Show($attributes, Application $app);
    
    
    
    
    
    
    
    
    
    
    
    protected function Render($name, array $context = [])
    {
        $event = new TwigPreRenderEvent($name, $context);
        $this->dispatcher->dispatch($event, TwigEvents::PRE_RENDER);
        $name = $event->getTemplate();
        $context = $event->getArguments();
        
        
        return $this->twig->render($name, $context);
    }
}