我是CakePHP的新手。這些日子裏,我創建了一些像hotscripts一樣的應用程序。我需要一個管理面板讓網站管理員爲公衆訪問者添加新的文章/應用和前端。CakePHP管理面板和前端
我正在尋找解決方案。我已經讀取了router_prefix爲admin。例如,在CategoriesController中。
public function admin_add() {
}
public function view($id) {
}
據我所知,這是解決方案之一。在分類控制器中,我設置了
$this->Auth->allow('view');
以便訪問者無需登錄即可訪問此頁面。我的問題是,這真的是管理和前端產品的解決方案嗎?
在此先感謝!
public $components = array(
'Auth' => array(
'authorize' => 'controller',
'loginRedirect' => array(
'admin' => true,
'controller' => 'dashboards',
'action' => 'index',
),
'loginError' => 'Invalid account specified',
'authError' => 'No Permission',
),
謝謝Anh Pham !!!我遵循你的建議,並將此代碼添加到AppController。我現在不知道管理員參數在loginRedirect中的含義是什麼?你能向我解釋這個嗎?
非常感謝。編輯版中的另一個問題。 – Ruiwant