![]() |
Single model per aplication . - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Single model per aplication . (/showthread.php?tid=76840) |
Single model per aplication . - tony.a - 06-25-2020 Is there any drawbacks in using a single model extending basemodel per aplication ,? Code: class Basic_Model extends CI_MODEL { PHP Code: Class myModel{ RE: Single model per aplication . - dave friend - 06-25-2020 You don't need the code you show. Any model loaded using $this->load->model(...) already creates a singleton. You can use the Auto-loading Resources feature to make the model available all the time for the application. BTW, you do not need the call to parent::__construct(); in Basic_Model because CI_Model does not have a constructor to call. |