正确延伸刀片中的截面

时间:2015-08-04 09:51:30

标签: php laravel-5 blade

我有主布局

master.blade.php

<  1 2 3 4 5 ...26 >
<... 4 5 6 7 8 ...26 >
    how to  use  j-query  to use this type of pagination.
 i do not want to use the  existing plugins.

<script>
$(document).ready(function(){
    var i=0;
    var j=0;
    var s=0;
    var k;
    var t;
    $("li").hide();
     for (k=0;k<6;k++){
         $("#l"+k).show();
         }
     s=1;
    $("#next").click(function(){
        s=s+1;

        // alert("s =" + s);
         t=(s*5);
         //alert("t ="+t); 
         if(s>0){
             i=(s-1)*5;
            // alert( "i value"+i);
             }   
         $("li").hide();   

        while(i<t){                      
        $("#l"+(i+1)).show();
        i++;
        }       
        if(t>$("list1 li").length)
            then (s=0);        
    });
    $("#back").click(function(){
        if(j<6){
        $("#l"+j).hide();
        j++;
        }
        else{j=0;}

    });
});
</script>

column.blade.php

<script>
  $(document).ready(function(){
   $('#send').on('click', function(){
    $.ajax({
      method: "POST",
      url: "example.com/sender.php",
      data: {"sender": "John", "receiver": "Doe"}
     });
    });
   });
</script>

当我尝试扩展 column.blade.php 并将我的内容添加到&#34;内容&#34;像这样的部分

admin.blade.php

@yield('content')

我的行为很奇怪。我的内容放在master.blade.php !!!我做错了什么?

如果我要添加@parent,我会获得双重数据(首先是column.blade,然后是master.blade)

如何才能正确覆盖或扩展该部分?

1 个答案:

答案 0 :(得分:0)

column.blade.php文件中,您定义了@section('content'),在admin.blade.php文件中,您正确地扩展了column.blade.php

但是在您的admin.blade.php文件中,您定义了一个新的@section('content')。这个新部分将覆盖@section('content')文件中的column.blade.php

您要执行的操作是将@parent添加到@section('content')文件中的admin.blade.php中。这将扩展列文件中的内容部分。