$router->setBasePath('/ecommerce/public');
$router->map( 'GET', '/', '', 'about_us' );
$match = $router->match();
当我重新加载 index.php 页面时工作得很好。var_dump($match) 显示了预期的结果;
然而,
$router->map( 'GET', '/about', '', 'about_us' )
当我输入 localhost/about 时不起作用。浏览器显示“找不到对象”错误。
我怀疑可能是我的根目录设置不正确,所以我也在$router->map()上面放了following
$router->setBasePath('/ecommerce/public');
不幸的是,setBasePath 不是一个解决方案。