Welcome Guest, Not a member yet? Register   Sign In
How to load Model?
#2

They are only the same if you have declared the model at the top of the file:

Code:
<?php  namespace App\Controllers;

use App\Models\UserModel;

class SomeController
{
    public function index()
    {
        $usermodel = new UserModel();
    }
}

Otherwise you'll get an error. If you haven't used them before, running through a quick crash course on namespaces would be very helpful.
Reply


Messages In This Thread
How to load Model? - by startbbs - 11-11-2016, 07:47 PM
RE: How to load Model? - by kilishan - 11-11-2016, 10:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB