Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top