Welcome Guest, Not a member yet? Register   Sign In
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

(This post was last modified: 09-08-2019, 08:33 AM by InsiteFX. Edit Reason: Added Example )

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




Theme © iAndrew 2016 - Forum software by © MyBB