最大功能嵌套级laravel 5刀片多级嵌套

时间:2016-02-07 17:19:07

标签: laravel templates nested blade extends

我需要你的帮助,因为当我尝试扩展另一个扩展模板时出现此错误。

 Maximum function nesting level of '100' reached, aborting!
  

编剧/ dashboard.blade.php

@extends('user.dashboard')
    @section('writer-dashboard')

        <li><a href="#"><i class="glyphicon glyphicon-calendar"></i>Calendrier</a></li>
       
    @endsection

  

用户/ dashboard.blade.php   

@extends('layouts.app')
   
    @section('content')
        <div class="row dashboard">
            <aside class="col-xs-12 col-lg-2 content-box-large">
                <ul class="nav">
                    
                    
                        <li class="current"><a href="#"><i class="glyphicon glyphicon-home"></i>Dashboard</a></li>
                        <li><a href="#"><i class="fa fa-user"></i>Profil</a></li>
                        <li><a href="#"><i class="fa fa-graduation-cap"></i>Cours</a></li>
                        @yield('writer-dashboard')
                   
                            
                    </ul>
                
            </aside>


    @endsection

     

布局/ app.blade.php   

<!doctype html>
<html lang="fr">
    <head>

    </head>
    <body>
     
        @yield('content')
       
      
    </body>
</html>
        
        
        
        

1 个答案:

答案 0 :(得分:1)

你正在创造无限循环。检查:

dashboard.blade.php中,您为writer-dashboard模板获得了收益。该模板再次调用仪表板和仪表板再次调用writer-dashboard。

使用@yield而不是@include指令。寻找Including Sub-Views in Control Structures' section.