Exemplo n.º 1
0
 public static function getTwig()
 {
     if (!self::$twig) {
         \Twig_Autoloader::register();
         $cache = Config::get('cache') ? Config::get('cache') . '/' : false;
         $loader = new \Twig_Loader_Filesystem(Config::get('views') . '/');
         $twig = new \Twig_Environment($loader, array('cache' => $cache, 'debug' => Config::get('debug')));
         // Add globals
         $twig->addGlobal('session', Session::getInstance());
         $twig->addGlobal('url', new URL());
         self::$twig = $twig;
     }
     return self::$twig;
 }
Exemplo n.º 2
0
 function test_if_flash_error_is_persisted()
 {
     Session::flash('error!', 'error');
     $this->assertEquals('error!', $_SESSION['Aura\\Session\\Flash\\Next']['Alter\\Ampersand\\Session']['error'], 'Test if the flash error was persisted in session');
 }