Home  >  Article  >  Backend Development  >  CodeIgniter includes one controller and another controller, and an error will be reported when instantiating it.

CodeIgniter includes one controller and another controller, and an error will be reported when instantiating it.

WBOY
WBOYOriginal
2016-08-04 09:19:021163browse

<code>Unable to locate the specified class: Session.php
</code>

Report the above error. There is this problem on stackOverflow. It is enough to change the referenced controller to extends CI_Model. However, I originally wanted to include the controller and cannot do that. How can I solve this problem?


Between the reference and the referenced controller, no error will be reported if the following code is written in any one of them. However, as long as the line that calls the constructor of the parent class is uncommented, an error will be reported again. Why is this? ? ?

<code>
function __construct(){
    //parent::__construct();
}</code>

Reply content:

<code>Unable to locate the specified class: Session.php
</code>

Report the above error. There is this problem on stackOverflow. It is enough to change the referenced controller to extends CI_Model. However, I originally wanted to include the controller and cannot do that. How can I solve this problem?


Between the reference and the referenced controller, no error will be reported if the following code is written in any one of them. However, as long as the line that calls the constructor of the parent class is uncommented, an error will be reported again. Why is this? ? ?

<code>
function __construct(){
    //parent::__construct();
}</code>

Maybe it’s because the relative path changed when you quoted it. Why do you need to quote the controller?

Why reference another controller? ? ? ? ?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn