2016-02-07 104 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中 –