• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Model Autoload

why load models without autoload or call load..in the view

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 )

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?

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".

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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