|
楼主 |
发表于 2016-1-22 17:38:32
|
显示全部楼层
本帖最后由 developerm 于 2016-1-22 17:44 编辑
你是说Admin控制器中吗?如果是,则有放这段代码的
你看是否是index方法有问题?
PHP复制代码
<?php
class Admin extends CI_Controller {
public function __construct ()
{
parent ::__construct ();
$this->load->helper('url');
$this->load->helper('url_helper');
$this->load->library('session');//加载session类
}
public function index ($page = 'index')
{
if ( ! file_exists(APPPATH .'/views/admin/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404 ();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
if(empty($this->session->userdata('name')))
{
$this->load->view('templates/header');
$this->load->view('welcome_message');
$this->load->view('templates/footer');
}
else
{
$this->load->view('templates/header_admin',$data);
$this->load->view('Admin/index');
$this->load->view('templates/footer_admin');
}
}
复制代码
|
|