Welcome Guest, Not a member yet? Register   Sign In
Model Autoload
#1
Question 

why load models without autoload or call load..in the view
Reply
#2

There is a global helper method for just that.

PHP Code:
$model model('your_model_name'); 

SEE: CodeIgniter 4 User Guide - Global Functions and Constants
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 07-28-2020, 10:24 AM by vinothkanth.)

Thank you for your answer. ..I dont want any models to load in the view.

I mean....$this->citizen_model->somefunction(); I call this on the view..but I am not load the citizen model in the view...but the function return values...why?..it is a bug on codeigniter?
Reply
#4

I guess you are using CodeIgniter 3 based on your last reply.

You can't remove that, it will always be accessible. You need to re-write how CodeIgniter works to get rid of that, it's not a bug. It's a "feature".
Reply




Theme © iAndrew 2016 - Forum software by © MyBB