Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 711
Webnet Avatar asked Jul 01 '26 13:07

Webnet


1 Answers

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!

like image 188
Henry Avatar answered Jul 03 '26 03:07

Henry