Welcome Guest, Not a member yet? Register   Sign In
Correct way to call the Model
#4

PHP Code:
// Create a new class manually
$userModel = new \App\Models\UserModel();

// Create a new class with the model function
$userModel model('App\Models\UserModel'false);

// Create a shared instance of the model
$userModel model('App\Models\UserModel');

// Create shared instance with a supplied database connection
// When no namespace is given, it will search through all namespaces
// the system knows about and attempt to located the UserModel class.
$db db_connect('custom');
$userModel model('UserModel'true$db); 

It's up to you.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Correct way to call the Model - by snape - 07-08-2021, 01:25 PM
RE: Correct way to call the Model - by paliz - 07-09-2021, 01:45 AM
RE: Correct way to call the Model - by ikesela - 07-09-2021, 04:16 AM
RE: Correct way to call the Model - by InsiteFX - 07-09-2021, 05:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB