Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates laravel刀片模板引擎内容显示在end html标记外部_Templates_Laravel_View - Fatal编程技术网

Templates laravel刀片模板引擎内容显示在end html标记外部

Templates laravel刀片模板引擎内容显示在end html标记外部,templates,laravel,view,Templates,Laravel,View,我对laravel框架非常陌生,我正在使用laravel 4.2,现在我的刀片模板引擎有问题。 在用户登录后的my laravel管理面板中,将显示一个仪表板页面。此页面运行正常。此页面由master.header.php(我的标题)和仪表板页面(我的左侧菜单)组成 刀片代码如下所示 <pre> below is my dashboard page code @extends('includes.header') @section('head') @par

我对laravel框架非常陌生,我正在使用laravel 4.2,现在我的刀片模板引擎有问题。 在用户登录后的my laravel管理面板中,将显示一个仪表板页面。此页面运行正常。此页面由master.header.php(我的标题)和仪表板页面(我的左侧菜单)组成

刀片代码如下所示

<pre>
   below is my dashboard page code 
   @extends('includes.header')
   @section('head')

   @parent   
   <title>DashBoard</title>
   @stop

   @section('content')
   LEFT MENU COMES HERE 
   @stop
</pre>
   <pre>Now in my left menu different links are there. 

下面是我的仪表板页面代码
@扩展('includes.header')
@第节(“标题”)
@母公司
仪表板
@停止
@节(“内容”)
左边的菜单在这里
@停止
现在在我的左菜单中有不同的链接。
所以我想在每个链接页面中包含header.blade.php和dashboard.blade.php

左菜单页面代码如下所示

<pre>
   below is my dashboard page code 
   @extends('includes.header')
   @section('head')

   @parent   
   <title>DashBoard</title>
   @stop

   @section('content')
   LEFT MENU COMES HERE 
   @stop
</pre>
   <pre>Now in my left menu different links are there. 

页面名称为:Employee.blade.php
@扩展('usercp.dashboard')
@第节(“标题”)
@停止
@节(“内容”)
嗨,这是我左边的菜单区之一
**发出**
但当我点击左菜单链接时,内容显示在标题处(嗨,这是我的左菜单部分之一)。
当我看到Employee.blade.php的源代码时,左边的菜单是Outside标记。
不在body标签中。
在这方面谁能帮我一下吗。

关于您的代码的一些想法:

  • 在左侧菜单页中,
    @部分(“内容”)
    未关闭,请添加
    @stop

  • @extends
    命令必须是刀片服务器中的第一行 模板,前面没有html/空格

  • 如果要包括其他刀片模板(例如页眉),请使用
    @include('partials.header')
    。通过扩展另一个模板,您可以 重写父模板的部分,该部分不是 我猜你想要什么头球