Ben
Ben

Reputation: 62484

Code Igniter Controller/Model name conflicts

I have a controller and model both named "account" without getting "cannot redeclare class". I'd like to add a prefix to Models or Controllers, or preferably both.

Any ideas?

Upvotes: 3

Views: 4389

Answers (2)

Jason Shultz
Jason Shultz

Reputation: 970

There should be an issue with this. if it was me, i would be a bit more descriptive with the prefix so you remember what the model or controller was for. I only say this because "account" is a little vague.

Upvotes: 0

Henry
Henry

Reputation: 290

I suggest that you call your model "account_model" and reference it like this:

$this->load->model('account_model', 'account');
$this->account->function();

I know it doesn't solve the problem, however I think that you might find it an adequate solution!

Upvotes: 9

Related Questions