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); }
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); }
public static function ajax($route, $path) { self::$path = $path; Sammy::process($route, 'XMLHttpRequest'); }