codeigniter-hooks

How to retrieve the third uri segment in a codeigniter hook

北城余情 提交于 2019-12-07 03:54:25
问题 I'm writing a custom post_controller hook. As we know, codeigniter uri structure is like this: example.com/class/function/id/ and my code: 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 } I've browsed the core Router.php file, which puzzled me a lot. thanks. 回答1: Using CodeIgniter URI core class Generally within CodeIgniter