Welcome Guest, Not a member yet? Register   Sign In
Autoload for models like BaseController
#2

You can create a base model and extend your other model on it.

You don’t need to deal with database connection. Your model connects automatically to the database and the db object is already available. 
Example: $myModel->db->affectedRows().

You can also autoload helpers in your controller: http://codeigniter.com/user_guide/incomi...ml#helpers
Example: protected $helpers = ['url', 'form'];
Reply


Messages In This Thread
RE: Autoload for models like BaseController - by includebeer - 06-19-2021, 09:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB