Beispiel #1
0
<?php

/*
 * Application Boilerplate
 */
\Fw\Twig::global_data("base", \Fw\Config::get("base"));
\Fw\Twig::global_data("assets", \Fw\Config::get("base") . "assets/build");
\Fw\Twig::global_data("server_ip", $_SERVER["SERVER_ADDR"]);
\Fw\Twig::global_data("is_dev", \Fw\Config::get("env", "application.php") == \Fw\Config::DEVELOPMENT ? true : false);
\Fw\Fwouter::init(array("base" => \Fw\Config::get("base")));
if (\Fw\Fwouter::$error) {
    _404(\Fw\Fwouter::$error);
}
// 404
function _404($reason = '')
{
    \Fw\View::twig("404.twig", array("reason" => $reason));
}
Beispiel #2
0
 static function twig($template_file, $inject = '')
 {
     self::output(\Fw\Twig::factory($template_file, $inject)->render());
 }
Beispiel #3
0
 /**
  * Twig Helper. This maybe should be somewhere else ;)
  *
  * @param $template_file
  * @param string $inject
  */
 function twig($template_file, $inject = '')
 {
     $this->output(\Fw\Twig::factory($template_file, $inject)->render());
 }