2016-02-07 108 views
0

我需要你的帮助,因为当我尝试扩展一个扩展另一个模板的模板时,出现此错误。最大函数嵌套级别laravel 5刀片多级嵌套

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

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

dashboard.blade.php你收益为writer-dashboard模板。该模板再次调用仪表板和仪表板再次调用编写器仪表板。

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

+0

扩展延伸另一个视图的视图是不可能的? 因为我想做类似: - >用户呈现user.dashboard - > Writer render writer.dashboard在user.dashboard中 –