Code Igniter Controller/Model name conflicts

后端 未结 2 1930
小鲜肉
小鲜肉 2021-01-20 08:20

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.

2条回答
  •  既然无缘
    2021-01-20 08:40

    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!

提交回复
热议问题