首页 > 解决方案 > Laravel Blade '@' 函数

问题描述

在下面的“@yield”功能不起作用,它显示为正常单词,不像刀片功能关键字

@yield('content')
</div>

@yield('footer')

标签: laravel-5

解决方案


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Admin | @yield('title')</title>
        <!--Has all the sylesheets attached already!-->
        @include('Elements/_head')  
        <!--Custom CSS or CSS Files for particular page-->
        @yield('styles')    
    </head>
    <body class="hold-transition skin-blue sidebar-mini" onload="startTime()">
        <div class="wrapper">
            <!--Application Header-->
            @include('Elements/_header')
            <!--Application Sidebar-->
            @include('Elements/_side')
            <!--Page Content Main-->
            <!-- Content Wrapper. Contains page content -->
            <div class="content-wrapper">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                  <h1>
                    @yield('title')
                    <small></small>
                  </h1>
                </section>

                <!-- Main content -->
                <section class="content">
                    <img id="loader" src="{{url::asset('images/loading.gif')}}">
                @yield('content')
                </section>
            </div>
            <!--Footer of Application--> 
            @include('Elements/_footer')         
        </div>
        <!--Has all the scripts already attached-->  
        @include('Elements/_base') 
        <!--Custom scripts for particular pages-->
        @yield('scripts') 
  </body>
</html>

推荐阅读