2013-05-26 3 views
6

मुझे अपने नियंत्रक में एक दृश्य प्रस्तुत करने में परेशानी हो रही है। मैं वर्तमान में लैरवेल 4 चला रहा हूं और नीचे मेरा कोड है। (बीटीडब्ल्यू, मैं अभी भी लैरवेल को विशेष रूप से नवीनतम संस्करण सीख रहा हूं जिसे अभी तक जारी नहीं किया गया है। मुझे पुराने संस्करणों से सीखना एक बुरा विचार है क्योंकि वर्तमान में बहुत सारे बदलाव दिखते हैं।)लार्वेल 4 मास्टर लेआउट प्रतिपादन नहीं

नियंत्रक/PluginsController.php

class PluginsController extends BaseController { 
    public function index() 
    { 
     return View::make('plugins.index')->with(array('title'=>"The Index Page")); 
    } 

विचारों/plugins/index.blade.php

@layout('templates.master') 

@section('header') 
    <h1>The Header</h1> 
@endsection 

@section('content') 
    testing the index.blade.php 
@endsection 


@section('footer') 
    <div style="background:blue;"> 
     <h1>My Footer Goes Here</h1> 
    </div> 
@endsection 

विचारों/टेम्पलेट्स/master.blade.php

<!doctype> 
<html> 
    <head> 
     <meta charset="UTF-8" /> 
     @yield('meta_info') 
     <title>{{$title}}</title> 
     @yield('scripts') 
    </head> 
    <body> 
     <div id="header"> 
      @yield('header') 
     </div> 

     <div id="wrapper"> 
      @yield('content') 
     </div> 

     <div id="footer"> 
      @yield('footer') 
     </div> 
    </body> 
</html> 
+0

तो अच्छा प्रश्न का उपयोग करना चाहिए, मैं एक ही समस्या थी – M98

उत्तर

8

@layout के बजाय @extends का उपयोग करके मेरी समस्या हल हो गई।

15

आप @layout के बजाय @extends, और @stop बजाय @endsection

संबंधित मुद्दे