Separate Admin and Front in codeigniter

后端 未结 3 1796
予麋鹿
予麋鹿 2020-12-02 19:11

What is the best way to separate admin and front-end for a website in codeigniter where as I was to use all libraries, models, helpers etc. in common, but only controllers a

3条回答
  •  借酒劲吻你
    2020-12-02 20:01

    I use a very simple approach: file folders. Check out the CI User Guide section, Organizing Your Controllers into Sub-folders.

    I have my public-facing website built as any other would be built with CodeIgniter. Then I have two additional folders, controllers/admin and views/admin.

    The admin controllers are accessed via http://[hostname]/admin/controller, and behave just as any other controller except they have specific authentication checks. Likewise, the views are simply called with the folder name included: $this->load->view('admin/theview');.

    I haven't found a reason to do anything more complicated than that.

提交回复
热议问题