【发布时间】:2025-12-25 22:10:11
【问题描述】:
我们正在使用 codeigniter 框架来构建应用程序,但是我们在配置“$route”以发送正确的请求时遇到了问题。
我们只需要正确设置这些路线。
我如何访问类别:
Category: http://localhost/codeigniter/category/'category-name'/
$route['category/(:any)'] = 'category/index/$1';
按字母分类的帖子列表:
Category Page by List: http://localhost/codeigniter/category/'category-name'/list/'A'/
$route['category/(:any)/lists/(:any)/'] = 'category/lists/$1';
我如何访问页面:
Page: http://localhost/codeigniter/page/'category-name'/'page-name'/
$route['page/(:any)'] = 'page/index/$1/$2';
我们正在使用类似的 rotue,也许我们有问题,请检查这些并告诉我如何解决。
在我们的 codeingiter 安装中,我们使用 'codeigniter' 目录,'category' 和 'page' 是控制器。在单引号中,我们发送值。
【问题讨论】:
标签: php regex codeigniter