/** * Check if current route is a route of a front page. * * @static * @access public * @return boolean * @since 1.0.0-alpha * @version 1.0.0-alpha */ public static function isFrontPage() { $oHomeRoute = Route::factory('home'); $sFrontPagePath = $oHomeRoute->path(); $sCurrentRoutePath = static::currentPath(); return $sFrontPagePath === $sCurrentRoutePath; }
<?php /** * Route file for an application * * Syntax for this file: * * <route name> => Route::factory() * * @package Kohana-Namespace-Routes * @copyright 2010 Sittercity, Inc. */ return array('default' => Route::factory('(<uri>)', array('uri' => '(.++)'))->defaults(array('controller' => 'page', 'action' => 'index')));
/** * 执行内部请求 *+------------ * @param Void * @return Void */ private function internal() { new Ada_Request_Internal($this, $this->response, Route::factory($this)->parser()->execute()); }
/** * 执行内部请求 * request::factory('welcome/say')->method()->execute(); * @param Void * @return Void */ private function internal() { new Ada_Request_Internal($this, Route::factory()->routes(Config::load('Route'))->matchs(Uri::pathinfo())); }
<?php return array('default' => Route::factory('(:controller(/:method(/:id)))')->defaults(array('controller' => 'welcome', 'method' => 'index')));