Welcome Guest, Not a member yet? Register   Sign In
Include model inside a model
#1

Hello! We are finally ready to use CodeIgniter 4. I only have some problems with using a model inside a model. I was expecting that I could use something like this:

PHP Code:
namespace App\Models;
use 
CodeIgniter\Model;
class 
Filters_model extends Model {

    function __construct(){
        // Call the Model constructor
        parent::__construct();
        $this->session session();
        $this->customers model('Customers_model');
    }



But that doesn't seems to work. I'm getting a "Service Temporarily Unavailable" error. In CI3 you could just put it in autoload and use it wherever you like.

How can I include a model inside a current model to use those functions of that model?
Reply


Messages In This Thread
Include model inside a model - by LuxesR - 06-18-2021, 12:13 AM
RE: Include model inside a model - by MGatner - 06-19-2021, 06:12 AM
RE: Include model inside a model - by LuxesR - 06-19-2021, 06:45 AM
RE: Include model inside a model - by paliz - 06-19-2021, 10:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB