且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Codeigniter中设置管理面板

更新时间:2023-11-29 21:22:58

更改文件结构(您需要在admin.php控制器中创建索引函数)

let change your files structure (You need to create an index function in your admin.php controller)

 project(may be root folder of CI)
    applications
       cache
       config
       controllers
           -admin
             index.php (method index)
           -blog.php
       system
       views
           -admin
              index.php
            blog.php

还将控制器名称更改为admin并查看负载

also change controller name to admin and view load

class Index extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
    }

    function index()
    {
        $this->load->view('admin/index');
    }
}

然后更改您的路线

$route['admin'] = 'admin/index';