L
L
Lander2017-08-08 11:53:33
CodeIgniter
Lander, 2017-08-08 11:53:33

Codeigniter: How to explain to the framework that the class should be loaded automatically?

Good afternoon.
It so happened that I needed to write something in Codeigniter 3. I think it’s clear that the base CI_Controller doesn’t have half of the necessary functionality, so I decided to make my Base_Controller in the Base_Controller.php file

class Base_Controller extends CI_Controller 
{
}

As a result, wherever I put this file, autoloader does not pick it up when I do:
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends Base_Controller 
{
  public function index()
  {
    $this->load->view('welcome_message');
  }
}

How to make the framework still see this class? I really don't want to do include every time.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
artem78, 2017-08-08
@usdglander

https://codeigniter.com/user_guide/general/autoloa...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question