Esempio n. 1
0
 public function render($template, $data = array())
 {
     if (!$template) {
         throw new Exception\Generic('NO_TEMPLATE', 'No template given');
     }
     $tpl = $this->engine;
     $tpl->assign($this->extra);
     $tpl->assign('display', $this->display);
     $tpl->assign('env', Env::get());
     $tpl->assign('data', $data);
     return $tpl->render($template);
 }
Esempio n. 2
0
 public static function secure($be_secure = true)
 {
     $env = Env::get();
     // Force https
     if ($be_secure and !$env->secure()) {
         static::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     }
     // Force http
     if (!$be_secure and $env->secure()) {
         static::redirect('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     }
 }