Welcome Guest, Not a member yet? Register   Sign In
How to load a model in Autoload file
#1

How can I load a model in ...\app\Config\Autoload.php?

PHP Code:
namespace Config;

use 
CodeIgniter\Config\AutoloadConfig;

class 
Autoload extends AutoloadConfig {

    public function __construct() {
         
//load here
         //i've tried,
         
$my_model = new \App\Models\My_model();
 
        $my_model model("App\Models\My_model");
    

Nothing is working.

What is the correct way? Looking for help.
Thanks in advance.
Reply


Messages In This Thread
How to load a model in Autoload file - by ciddict - 04-11-2021, 11:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB