dowi
dowi

Reputation: 1045

what is codeigniter's load->model third arguments?

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

Answers (1)

beerwin
beerwin

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

Related Questions