'URL_ROUTER_ON' => true, //开启路由
'URL_ROUTE_RULES' => array( //定义路由规则
'news/:year/:month/:day' => array('News/archive', 'status=1'),
'news/:id' => 'News/read',
'news/read/:id' => '/news/:1',
), public function read(){
dump($_GET);
}
public function archive(){
dump($_GET);
}url:http://ceshi.com/index.php/news/2012/01/08
结果是这样:
array(6) {
["year"] => string(4) "2012"
["month"] => string(2) "01"
["day"] => string(6) "08.php"
["news"] => string(4) "2012"
["01"] => string(2) "08"
["status"] => string(1) "1"
}
最佳答案