Single model per aplication . |
Is there any drawbacks in using a single model extending basemodel per aplication ,?
Code: class Basic_Model extends CI_MODEL { PHP Code: Class myModel{
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. |
Welcome Guest, Not a member yet? Register Sign In |