Anastasie Laurent
Anastasie Laurent

Reputation: 1179

laravel blade empty page

This is my route

Route::get('login', function(){
    return View::make('admins.login');
});

This is my admins/login.blade.php

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>

{{ Form::open(array('route' => 'admins.store', 'class' => 'loginClass')) }}
<ul>
    <li>
        {{ Form::text('username', '', array('placeholder' => 'Username'))}}
        <span>test</span>
    </li>
</ul>

{{ Form::close() }}
@stop

</body>
</html>

The result is empty page. However, when the change the admins/login.blade.php to:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>
TEST TEST TEST
</body>
</html>

I got TEST TEST TEST printed in the browser.

what am I missing wrong please?

Upvotes: 1

Views: 411

Answers (1)

Chris Forrence
Chris Forrence

Reputation: 10114

Your blade page includes the @stop within it, but there's no accompanying @section tag.

It should look like this:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>

{{ Form::open(array('route' => 'admins.store', 'class' => 'loginClass')) }}
<ul>
    <li>
        {{ Form::text('username', '', array('placeholder' => 'Username'))}}
        <span>test</span>
    </li>
</ul>

{{ Form::close() }}

</body>
</html>

Upvotes: 2

Related Questions