我是 CodeIgniter 4 的新手。
@time
虽然 Pages 控制器工作正常,但管理员控制器一直说 404-file not found admin。
我认为我当前的以下路线设置有问题。请帮忙。
I have one controller named Pages and helps to display website pages normally. Then I have another controller named Admin which is suppose to load the admin view with its own header and footer files.
答案 0 :(得分:0)
试着像这样调整你的代码。
$routes->setDefaultController('Pages');
$routes->setDefaultMethod('default');
// 路由定义
$routes->resource('pages');
$routes->get('/', 'Pages::index');
$routes->get('(:any)', 'Pages::default/$1');