• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Celling class model and function model

#1
I am having problems when calling the function model to the controller, please help me

thank you.


chau
Reply

#2
So what problems are you having? That tell's nothing about your problem.

It would be something like this:

PHP Code:
// Loading a model in the Controller.
$users = new UserModel();

// Using the Model in the Controller.
$user $users->getUserById($id); 

If that is what you are looking for.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(09-08-2019, 08:26 AM)InsiteFX Wrote: So what problems are you having? That tell's nothing about your problem.

It would be something like this:

PHP Code:
// Loading a model in the Controller.
$users = new UserModel();

// Using the Model in the Controller.
$user $users->getUserById($id); 

If that is what you are looking for.

do not forget to add the model at the beginning of the controller:

PHP Code:
use App\Models\UsersModel
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.