Reputation: 1045
in codeigniter, when loading a model there is a third Boolean argument. should it always be true? what is its best practice? does it matter if loading multiple models in one controller function?
thanks allot!
Upvotes: 0
Views: 204
Reputation: 10337
This is in the CI documentation:
"You can tell the model loading function to auto-connect by passing TRUE (boolean) via the third parameter, and connectivity settings, as defined in your database config file will be used..."
You can read more about it here: Connecting to your Database
The third argument should be set to true, if you wish the model to automatically connect, otherwise you may get a database error.
Upvotes: 1