extending the controller |
I am attempting to follow CodeIgniter tutorials that focus on extending the controller. The tutorial advises placing the following code in the MY_Controller file:
PHP Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); However, this results in the following error: Fatal error: Class 'Controller' not found in /home/chimeri1/public_html/application/libraries/MY_Controller.php on line 3 If I substitute CI_Controller instead of Controller, the code works. What is the difference between the two? Also, should the closing PHP tag ?> be included at the end of the MY_Controller file? Some tutorials omit it. Thank you in advance for your assistance.
It's CI_Controller not Controller for CodeIgniter 3.
CodeIgniter 4 uses Controller. PHP Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |