문제

In my routes.php file:

Route::get('register', function(){
return View::make('register');
});

with my register view as so:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Register</title>
</head>
<body>
 <h2>Register!</h2>
  {{ Form::open(array('url' => 'register')) }}
  {{ Form::close() }}
 </body>
</html>

However the stuff between the braces fails to generate any HTML at all? All I see is:

{{ Form::open(array('url' => 'register')) }}
{{ Form::close() }}

in the browser when really

<form method="POST" action="http://localhost:8000/register" accept-charset="UTF-8">
 <input name="_token" type="hidden" value="1gDaHZGie4TwE47wIT7T7uUU5hQOKu8hfFHG6Dwj">
</form>

should be displayed? Have you seen this before?

도움이 되었습니까?

해결책

Add .blade.php to your view file name

You probably have your file named view.php

You need to name your file view.blade.php

다른 팁

My problem here was that I had used double-curly brackets: {{ some code here }} instead of using a curly followed by two exclamation marks: {!! some code here !!}. Laravel 5.1 on PHP 5.5.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top