我正在寻找有关如何避免的建议:
$route = array(
'directory' => 'accountdirectory/index',
'directory/(:any)' => 'accountdirectory/index/$1',
'directory/(:any)/(:num)' => 'accountdirectory/index/$1/$2' ...
如果可能的话,通过采用更宽容的单一模式,如果所有段都不存在,则路线不会中断:
'directory(/)?(:any)?(/)?(:any)' => 'accountdirectory/index/$1/$2'
路由
- 目录/全部
- 目录/
- 目录/全部/10