简体   繁体   中英

Blade Layout not displyaing (rendering) properly in laravel blade

Here is my Code for the Layout Blade

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Smart Bus</title>
<!-- css section start -->
 {{ HTML::style('assets/css/style.css') }}
<!-- js section start -->
</head>
<body>
<div class="main-total-container">
    <div class="main-content-container home-main-container">              <!-- main content container start -->
          <div class="login-tot-container">   <!-- login panel start -->
               @yield('body')    
               <div class="shodow_box">
               </div>
          </div>                          
    </div>                                
</div>
</body>
</html>

And here is the code for the Home :

@extends('layouts.loginlayout')
@section('body')
<div class="login-panel">
                    <div class="logo-login">
                         <img src="assets/images/logo.png" alt="MashaTaxi"/>
                    </div>
                    <div class="welcome-panel">
                       <h3>Welcome Masha Taxi</h3>
                    </div>
                    <div class="log-head-panel">
                       <h3>Login</h3>
                    </div>
                    <form action="#" method="post" enctype="multipart/form-data">
                     <ul>
                         <li><span class="icon username-icon"></span><input type="text" placeholder="Username" /></li>
                         <li><span class="icon password-icon"></span><input type="password" placeholder="Password" /></li>

                         <li>
                             <input type="submit" value="Submit"/>
                         </li>
                          <li>
                             <a href="#" class="forgot_btn gen_btn">Forgot password</a>
                         </li>
                      </ul>
                    </form>
</div>

But whenever i use to see the pay, it blade appears wrongly. i mean it is not rendering properly.

So, when i see the page source it is displaying like this

<div class="login-panel">
                    <div class="logo-login">
                         <img src="assets/images/logo.png" alt="MashaTaxi"/>
                    </div>
                    <div class="welcome-panel">
                       <h3>Welcome Masha Taxi</h3>
                    </div>
                    <div class="log-head-panel">
                       <h3>Login</h3>
                    </div>
                    <form action="#" method="post" enctype="multipart/form-data">
                     <ul>
                         <li><span class="icon username-icon"></span><input type="text" placeholder="Username" /></li>
                         <li><span class="icon password-icon"></span><input type="password" placeholder="Password" /></li>

                         <li>
                             <input type="submit" value="Submit"/>
                         </li>
                          <li>
                             <a href="#" class="forgot_btn gen_btn">Forgot password</a>
                         </li>
                      </ul>
                    </form>
</div>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Smart Bus</title>
<!-- css section start -->
 <link media="all" type="text/css" rel="stylesheet" href="http://localhost/masnataxi/assets/css/style.css">

<!-- js section start -->
</head>
<body>
<div class="main-total-container">
    <div class="main-content-container home-main-container">              <!-- main content container start -->
          <div class="login-tot-container">   <!-- login panel start -->

               <div class="shodow_box">
               </div>
          </div>                          
    </div>                                
</div>
</body>
</html>

What is the mistake i am doing while using the blade layout

I am using the

@extends('layouts.loginlayout')
@section('body')

in proper way also i @yield('body') in the proper position.

What is the mistake i am doing and how can i fix this ?

Update :

For better understanding

The HTML Tag should display first, then the body then the HTML Should end

您忘记了@section('body') @stop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM