Yaf_Router::addConfig

(Yaf >=1.0.0)

Yaf_Router::addConfig向 Router 中添加配置文件中定义的路由

说明

publicYaf_Router::addConfig(Yaf_Config_Abstract$config): bool

将 application.ini 配置中定义的路由规则添加到 Yaf_Router 的路由栈中

警告

本函数还未编写文档,仅有参数列表。

参数

此函数没有参数。

返回值

Yaf_Config_Abstract 实例,包含一个或多个有效的路由配置

示例

示例 #1 application.ini() 示例

;the order is very important, the prior one will be called first ;a rewrite route match request /product* routes.route_name1.type="regex" routes.route_name1.match="#^list/([^/]*)/([^/]*)#" routes.route_name1.route.controller=Index routes.route_name1.route.action=action routes.route_name1.map.1=name routes.route_name1.map.2=value ;a simple route match 
$router->addConfig(Yaf_Registry::get("config")->routes);
}
?>
To Top