thinkphp路由配置 php7.0,thinkphp3.2 路由设置方法
生活随笔
收集整理的這篇文章主要介紹了
thinkphp路由配置 php7.0,thinkphp3.2 路由设置方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在配置文件中增加路由設置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
總結
以上是生活随笔為你收集整理的thinkphp路由配置 php7.0,thinkphp3.2 路由设置方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php word转pdf linux,L
- 下一篇: java 编写方法和属性,编写一个关于教