Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
class Demo extends CI_Controller { function __construct() { parent::__construct(); } }
演示类的构造函数正在调用其父类的构造函数,在这种情况下是 CI_Controller
类Demo正在扩展CI_Controller.
Demo
CI_Controller
所以CI_Controller类的所有公共属性都可以被覆盖Demo。
function __construct()意思是constructor如果类Demo。
function __construct()
constructor
其中function __construct(),parent::__construct()表示在构造函数中,我们也在调用父类的构造函数。
parent::__construct()