Codeigniter 的路线问题!

标签 codeigniter

我正在尝试执行此路线技巧:

$route['cp/roles/:num'] = "cp/roles/index/:num";

但它不起作用:( 请帮助我!!

提前致谢。

最佳答案

根据 URI Routing 的文档:

$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";

A URL with "product" as the first segment, and a number in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

因此,对于您的特定实例,您将执行以下操作:

$route['cp/roles/(:num)'] = "cp/roles/index/$1";

关于Codeigniter 的路线问题!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6472432/

相关文章:

forms - Codeigniter form_open 指定id

php - CodeIgniter 中的子文件夹

php - Codeigniter Controller 也没有加载 View 错误消息

php - codeigniter:将值从数组1插入到数组2?

php - 在 CodeIgniter 应用程序中实现服务层的正确方法

php - 尚未安装或启用MongoDB PECL扩展 php7.0 codeigniter cimongo library ubuntu16.04

codeigniter - html 是使用 jquery ajax 传递的,但 pdf 没有在 mpdf 中为 codeigniter 生成

php - 在 codeigniter 中有什么方法可以检查 ( $this->db->group_start(); ) 即组是否已经启动。或任何技巧

php - 无法使用 codeigniter 在 AWS [Ubuntu] 上上传文件

php - 使用 Codeigniter Active Record 计算行总数