<?php 
final class Twig{
  public $data = array();
  
  public function fetch($filename){
    require_once DIR_SYSTEM . 'library/template/vendor/autoload.php';

    $loader = new Twig_Loader_Filesystem(DIR_TEMPLATE);
    $twig = new Twig_Environment($loader, array(
        'autoescape' => false,
        'cache'      => DIR_CACHE,
    ));

    $output  =  $twig->render($filename, $this->data);

    return $output;  
  }
  
}