/**
  * TwigTemplateClient constructor.
  * Overrides the parent so I can setup any helper functions and interesting parser settings
  *
  * @param $templateClient Twig_Environment
  * @param $config Config
  */
 public function __construct($templateClient, Config $config)
 {
     $this->config = $config;
     parent::__construct($templateClient);
     $lexer = $this->getLexer();
     $this->templateClient->setLexer($lexer);
 }
Beispiel #2
0
 /**
  * Sends a rendered html page
  *
  * @param $template
  * @param array|null $data
  * @param array|null $headers
  * @param int $responseCode
  *
  * @return mixed
  */
 public function send($template, array $data = [], array $headers = [], $responseCode = self::OK)
 {
     $this->addHeader('Content-Type', 'text/html;charset=UTF-8');
     $this->addHeaders($headers);
     $this->raw($this->templateClient->render($template, $data), $responseCode);
 }