Instantly share code, notes, and snippets.

What would you like to do?
class Controller_Login extends Controller
public function action_index()
Auth::check() and Response::redirect('welcome');
$error = null;
$auth = Auth::instance();
if (Input::post()) {
if ($auth->login(Input::post('username'), Input::post('password'))) {
// ログイン成功時、ログイン後のページへリダイレクト
// ログイン失敗時、エラーメッセージ作成
$error = 'ユーザ名かパスワードに誤りがあります';
$view = View::forge('login/index');
$view->set('error', $error);
return $view;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment