2016-08-08 56 views
2

當我在codeigniter中加載鉤子時,鉤子成功加載但超級對象不成功。superobject未在codeigniter中加載鉤子

public function __construct() { 
    $this->CI =& get_instance(); 
    // This gives me nothing 
    print_r($this->CI); 
    // This works fine 
    echo "Hello!"; 

} 

笨版本:3.1.0

任何想法?

回答

1

您應該使用post_controller_constructorpost_controller,而不是pre_controllerpre_system

檢查docs

此時沒有路由或其他進程發生。