Welcome Guest, Not a member yet? Register   Sign In
Share models,libraries,helpers multi applications
#4

Try adding just the use clause first if it still wont work add the psr4 namespaces below and try it.

Did not have time to test this.

PHP Code:
<?php

namespace App\Controllers;

use 
shared\Models\TaskModel;

class 
Home extends BaseController
{
    public function index()
    {
        $userModel = new \shared\Models\TaskModel();
    }

    //--------------------------------------------------------------------
}

// You may need to also add them to the app/Config/Autoload.php.

public $psr4 = [
    'shared\helpers'   => ROOT 'shared/helpers',
    'shared\models'    => ROOT 'shared/models',
    'shared\libraries' => ROOT 'shared/libraries',
]; 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Share models,libraries,helpers multi applications - by InsiteFX - 12-24-2020, 12:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB