我在CodeIgniter中玩弄了一下,我試圖覆蓋orde中的默認CI_Controller來創建某種誘人的系統。CI:使用會話保護視圖
但現在我遇到了一個問題,我的網站將有不同的訪問者佈局,一旦用戶登錄,佈局將更改爲其他內容。 什麼是最好的方式來實現這一點,我會創建一個數組,並檢查用戶是否可以訪問該視圖?
比方說,用戶轉到www.site.com/index.php/dashboard,/儀表板應該只對登錄用戶可見,我將如何能夠檢查這個?
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
function _output($content)
{
// Load the base template with output content available as $content
$data['content'] = &$content;
echo($this->load->view('html_guest', $data, true));
}
private function _check_auth()
{
}
}