Skip to Content
PHPCODE
CodeIgniter Base Controller
codeigniter code / July 24, 2018
Base Controller step by step created
Step 1 :- go to codeigniter folder and go to core folder
Step 2 :- go to core folder and created file name this(MY_controller.php)
step 3 :-
For Example this like
Note :Why CI_Controller extends beacuase CI_Controller beacuase CI_Controller features used    class MY_Controller extends CI_Controller
{
}
This used to all controller used not created __construct() write
CI_controller featcures used this class MY_Controller
CI_Controller inheritance  MY_Controller
step 4 :- go to application,Controller Welcome
class Welcome extends MY_Controller {
}
Note :MY_Controller inheritance CI_Controller
step 5 :- created admin.php controller and User controller created
Public Controller created this
Articles List
Articles View
Admin Controller created this
Login
Logout
Add Article
Edit Article
Delete Article
class User extends MY_Controller
{
}
and created user.php controller createdclass user extends MY_Controller
{
public function index()
{
echo  “public index”;
}
}
PHPCODE © 2024