Laravel中的错误消息

时间:2014-11-27 10:33:52

标签: redirect laravel

我使用redirect :: back() - > withErrors($ exception)但无法在我的页面上显示错误消息。 这是我的控制器

try{

    }
    catch(ParseException $pex){
        $error=var_dump($pex->getMessage());
        return Redirect::back()->withInput()->withErros(array('msg'=>$error));
    }

这是我的观点

{ Form::open(array('action' =>'UsersController@register','class' => 'form-horizontal','id'=> 'registrationForm' ,'name' => 'registrationForm','method' => 'POST')) }}
            <div class="body bg-gray">
                <!--Kullanicinin girmesi gereken bilgiler-->
                @if($errors->any())
                    <div class="form-group has-error">
                        <div class="col-sm-12">
                                 <h4>Error:{{$erros->first('code')}}</h4><br/>
                                 <label>{{$errors->first('msg')}}</label>
                        </div>
                    </div>
                @endif

有什么想法吗? 感谢

0 个答案:

没有答案
相关问题