注意是 thinkphp 5 不是 thinkPHP3
function 位置如下: C:\AppServ\www\t5\yb_application\yb_mokuai\controller\MyController.php
public function echoanumber( $number =1 )
{
echo "<title>输出一个数字</title>";
echo $number;
}
使用 http://localhost/t5/yb_index/yb_mokuai/my_controller/echoanumber/number/888 可以访问;
但是我在 C:\AppServ\www\t5\yb_application\route.php 加了路由规则:
'aaa[:number]'=>
[
yb_index/yb_mokuai/my_controller/echoanumber/number',
['method'=>'get',]
]
然后访问 http://localhost/t5/aaa/888 的时候居然 Not Found
请问那里出错了?是路由规则写错了地方,还是写错了???
路由规则与路径不匹配,路由中匹配aaa11这样的路由,但是这类路由好像有另外的配置方法,tp组合变量路由