在配置文件中增加路由设置Application\Common\Conf\config.php
下面是ThinkPHP3.2路由设置中规则表达式的配置方式
return array(
'URL_ROUTER_ON'=>true,
'URL_ROUTE_RULES'=>array(
'article/:id\d' => 'article/detail',//=>/home/article/detail/1
'product/:id\d' => 'product/detail',//=>/home/product/detail/1
'try/:id\d' => 'try/detail',//=>/home/try/detail/1
'try/report/:id\d' => 'try/report',//=>/home/try/report/1
'test' =>
function(){
echo 'just test';
},
'hello/:name' =>
function($name){
echo 'Hello,'.$name;
}
),
);
?>
具体方法请阅读官方文档:
http://document.thinkphp.cn/manual_3_2.html#rule_route