Php 在laravel中扩展页眉和页脚
我正在使用Laravel5.2创建一个新项目。因为我是新来的。因此,我正在创建新的页面和目录结构,如下所示:Php 在laravel中扩展页眉和页脚,php,laravel-5.2,Php,Laravel 5.2,我正在使用Laravel5.2创建一个新项目。因为我是新来的。因此,我正在创建新的页面和目录结构,如下所示: -views - layouts - default.blade.php - page - index.blade.php - templates -common - header.blade.php - footer.blade.php 现在在page/index.blade.php中,我需要扩展默认布局。我的代码如下。。 LAYOU
-views
- layouts
- default.blade.php
- page
- index.blade.php
- templates -common
- header.blade.php
- footer.blade.php
现在在page/index.blade.php中,我需要扩展默认布局。我的代码如下。。
LAYOUTS/DEFAULT.BLADE.PHP
@include('templates.common.header')
@yield('section')
@include('templates.common.footer')
在索引页中,我定义了该部分,但导致的错误如下:
FatalErrorException in 1d36838b56f16e2e06a8567cdd5270af26ec6aa8.php line 1: syntax error, unexpected '__data' (T_STRING)
请给我建议一些解决办法。。。。
谢谢你在你的结构中
模板-header.blade.php-footer.blade.php
在模板中没有目录公共,它在
@包括('templates.common.header')
还要检查index.php的第一行:
@extends('layouts.default')
在您的结构中模板-header.blade.php-footer.blade.php
在模板中没有目录公共,它位于
@包括('templates.common.header')
还要检查index.php的第一行:
@extends('layouts.default')