Welcome Guest, Not a member yet? Register   Sign In
Model in subfolder not working
#1

In the controller:

PHP Code:
$companyListModel = new \App\Models\rt3\CompanyListModel(); 

The Models folder has an Rt3 folder with the CompanyListModel.php in it.

PHP Code:
<?php namespace App\Models;

use 
CodeIgniter\Model;

class 
CompanyListModel extends Model
{
    protected $table 'CompanyList';
    protected $DBGroup 'rt3';

    protected $allowedFields = [
      // database list here
    ];

    protected $primaryKey "id";

    protected $returnType 'App\Entities\CompanyList';




Get this error:

Code:
Class 'App\Models\Rt3\CompanyListModel' not found

What am I doing wrong?
Reply


Messages In This Thread
Model in subfolder not working - by Kaosweaver - 01-12-2022, 12:42 PM
RE: Model in subfolder not working - by iRedds - 01-12-2022, 01:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB