Exemplo n.º 1
0
 /**
  * Redirect to
  *
  * @access public
  * @param string $url
  * @param bool $rewrite
  */
 public static function redirect($url, $rewrite = true)
 {
     if ($rewrite) {
         // TODO: I don't actually know why there is a try/catch around this?
         try {
             $url = \Skeleton\Core\Util::rewrite_reverse($url);
         } catch (\Exception $e) {
         }
     }
     header('Location: ' . $url);
     echo 'Redirecting to : ' . $url;
     exit;
 }
Exemplo n.º 2
0
 /**
  * Filter rewrite
  *
  * @param string $url
  * @return string $output
  */
 public function rewrite_filter(\Twig_Environment $env, $url)
 {
     if (class_exists('\\Skeleton\\Core\\Util')) {
         return \Skeleton\Core\Util::rewrite_reverse($url);
     }
     return $url;
 }