2011-02-03 118 views

回答

0

是的,您可以创建一个名为admin的视图和一个名为admin的控制器;不会有冲突。

使用模板库中,你会想要做这样的事情:

在配置/ template.php文件

$template['admin']['template'] = 'admin/admin_template.php'; // in your views 

// create a new template and its regions 
$template['admin']['regions'] = array(
    'header', 
    'content', 
    'footer', 
); 

然后在你的管理控制:

class Admin extends CI_Controller { //ci 2.0 

    function __construct() 
    { 
     parent::__construct(); 
     $this->load->library('template'); 
     $this->template->set_template('admin'); // set the admin template 
    } 

    // carry on as normal 
} 
+0

非常感谢你@Ross :) – Sjmon 2011-02-03 15:51:32

0

设置我的路线要经过/管理及用于管理员的操作都在/ views/admin/modelname

我也使用tankAuth这是非常好的。

+0

什么我正在考虑但我使用该模板,我不知道如何在视图/管理/如果有一个新的template.php文件没有包含“主要”网站元素:/ – Sjmon 2011-02-03 15:11:11