我正在编写自定义的post_controller hook。正如我们所知,CodeIgniter的URI结构如下:
example.com/class/function/id/
我的代码如下:
function hook_acl()
{
global $RTR;
global $CI;
$controller = $RTR->class; // the class part in uri
$method = $RTR->method; // the function part in uri
$id = ? // how to parse this?
// other codes omitted for brevity
}
我已经浏览了核心的Router.php文件,这让我感到困惑。
谢谢。
$CI->uri->segment(3);
)。 Codeigniter已经有一个可供使用的类。 我应该更仔细地阅读CI用户指南。 - Darren20