CakePHP は初めてです。学生、スタッフ、管理者など、さまざまな役割に複数のログインを作成しようとしています
私はこれらのチュートリアルに従いました:簡易認証
管理者ログインは現在機能しています。
今、学生のコントローラーとビューを使用して学生のログインを作成したいと考えています。
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'classes', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'users', 'action' => 'login')
)
);
function beforeFilter(){
if (isset($this->params['admin'])) {
$this->layout = 'admin_default';
}
elseif (isset($this->params['student'])){
$this->layout = 'student_default';
}
$this->Auth->allow('index', 'view');
}
}
どうすればいいですか助けてください。ありがとうございました。