/** * create twig template engine instance * @param string $pSection */ public function __construct(\Savant\CApplication $pApplication) { parent::__construct('default'); \Twig_Autoloader::register(); try { $tplFolder = $pApplication->VIEWS_DIR . \DIRECTORY_SEPARATOR . $pApplication->requestController; $loader = new \Twig_Loader_Filesystem($tplFolder); $options = array('cache' => $this->COMPILE_DIR . \DIRECTORY_SEPARATOR . 'Twig'); $options = array('cache' => false); $this->twig = new \Twig_Environment($loader, $options); $this->application = $pApplication; $this->setTemplateDir($pApplication->VIEWS_DIR . \DIRECTORY_SEPARATOR . $pApplication->requestController); } catch (\InvalidArgumentException $e) { throw new ETwig("Unaible to load view %s from %s", $pApplication->requestController, $tplFolder); } catch (\Exception $e) { throw new ETwig("could not initialize Twig Template Engine - error: " . $e->getMessage()); } }
/** * create chunk instance */ public function __construct($pSection = 'default') { parent::__construct($pSection); }
/** * create graph renderer instance * @param string $pSection */ public function __construct($pSection = 'default') { parent::__construct($pSection); self::$JPGRAPH_DIR = \Savant\CBootstrap::$EXT_DIR . \DIRECTORY_SEPARATOR . 'jpgraph' . \DIRECTORY_SEPARATOR . 'src'; $this->graph = new \Graph(self::$WIDTH, self::$HEIGHT); }