ThinkPHP5路由
測(cè)試代碼:public function info($id){
echo url('index/index/info',['id'=>10])."
";
return "{$id}";}
運(yùn)行結(jié)果:/web/public/index/index/info/id/10.html
已經(jīng)配置了路由:'url_route_on' => true,
? ? ? ? ? ? ? ? ?'url_route_must' => false,
'posts/:id' => 'index/index/info'
但是訪問(wèn)的路徑用localhost/posts/2.html就報(bào)錯(cuò),這是什么問(wèn)題?
2017-07-28
posts/:id=>'/web/public/index/index/info'