내 laravel 응용 프로그램의 로그인 페이지에 액세스 할 때 Undefined variable: errors (View: D:\PhpstormProjects\laravel\resources\views\login.blade.php)
오류가 발생합니다.Laravel Blade View - 정의되지 않은 변수 : 오류
은 http://laravel.com/docs/master/validation#error-messages-and-views에 따르면, $ 오류는 항상 자동으로 설정해야합니다
그래서, 오류 변수 $ 항상 모든 요청에, 모든 뷰에서 사용할 수 있습니다하는 것이 중요하다, $ errors 변수가 항상 정의되어 있고 안전하게 사용할 수 있다고 편리하게 가정 할 수 있습니다.
@extends('layouts.master') @section('main') <div id="loginwrapper"> <h2>Please authenticate</h2> @if ($errors->has()) <div id="error"> {{ $errors->first() }} </div> @endif {!! Form::open(['id' => 'loginform', 'name' => 'loginform']) !!} ... Form stuff ... {!! Form::close() !!} </div> @stop
뷰가 나는 laravel 5.0 개발 버전을 사용하고 간단한
View::make('login');
에 의해 생성되는 :
이
블레이드 파일입니다.누구나 이유를 알고 있습니까?
정상 작동합니다. 'V-5.0'에서도 테스트되었습니다. –
아마도 새로운 새로운 복사본 인 경우 문제를'github'에 버그로 열어야합니다. –
[This] (http://stackoverflow.com/a/34421349/52499) 이유가 있습니다 –