Autoload for models like BaseController |
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']; |
Messages In This Thread |
Autoload for models like BaseController - by LuxesR - 06-19-2021, 08:35 AM
RE: Autoload for models like BaseController - by includebeer - 06-19-2021, 09:40 AM
RE: Autoload for models like BaseController - by LuxesR - 06-19-2021, 12:17 PM
RE: Autoload for models like BaseController - by MGatner - 06-22-2021, 05:22 AM
RE: Autoload for models like BaseController - by MGatner - 06-22-2021, 05:23 AM
RE: Autoload for models like BaseController - by LuxesR - 06-22-2021, 05:55 AM
|