应该使用Controller Argument
function view($post_id) {
...
}
Run Code Online (Sandbox Code Playgroud)
或者uri-> segment
function view() {
...
$post_id = $this->uri->segment(3);
...
}
Run Code Online (Sandbox Code Playgroud)
只是为了简单的博客文章ID.有区别吗?