예제 #1
0
 public static function pre_dispatch($uri)
 {
     $path = explode('/', $uri);
     $controller = $path[0];
     $action = empty($path[1]) ? 'index' : $path[1];
     $format = 'html';
     if (preg_match('/\\.(\\w+)$/', $action, $matches)) {
         $action = str_replace($matches[0], '', $action);
         $format = $matches[1];
     }
     self::$path = $controller . '#' . $action;
     self::dispatch($format);
 }
예제 #2
0
파일: router.php 프로젝트: phn007/MyTools
 public static function pre_dispatch($uri)
 {
     /*
      * Define Variable for product detail page
      * ----------------------------------------------------------------------
      */
     //Controller และ Action
     $controller = 'product';
     $action = 'index';
     self::$path = $controller . '#' . $action;
     //http://domain.com/category-slug/keyword-slug.html
     $path = explode('/', $uri);
     $product_file = $path[0];
     $product_key = str_replace(FORMAT, '', $path[1]);
     $params = array($product_file, $product_key);
     self::dispatch($params);
 }
예제 #3
0
 public static function ajax($route, $path)
 {
     self::$path = $path;
     Sammy::process($route, 'XMLHttpRequest');
 }