Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

时间:2014-08-15 14:09:28

标签: php laravel

我有这个例外错误:

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

当我尝试执行我的项目时。
路线:

     Route::get('ouvrircompte', function()
    {
        return View::make('user.ouvrircompte')
        ->with('title', 'Reserver');
         });


     Route::post('ouvrircompte', 'UserController@ouvrircompte');

控制器:

public function ouvrircompte()
{
$credentials = array(
    'email' => Input::get('email'),
    'password' => Input::get('password'),
    );

    try{
        $user = Sentry::authenticate($credentials, false);
        $user_id=$user->id;
        if($user)
        {
            Session::put('user_id', $user_id);
            return Redirect::to('user/confirmReserver')->with('user_id', $user_id);
        }
    }
    catch (\Exception $e)
    {
        return Redirect::to('user/ouvrircompte')->withErrors(array('ouvrircompte' => $e->getMessage()));
    }
}

查看:

<form method="post" action="user/confirmReserver">
<button class="btn btn-success" type="submit" value="ouvrircompte">Envoyer</button>

当我提交表格时,这会向我显示错误。

0 个答案:

没有答案