【发布时间】:2016-12-29 00:50:37
【问题描述】:
我的刀片结构有问题。我有一个基本布局模板、一个内容页面模板和子模板。
以下sn-ps作为参考
基础模板
<!DOCTYPE html>
<html lang="en">
@include('head')
</head>
<body>
@include('body-open')
@yield('main')
@include('footer')
@include('body-close')
</body>
</html>
内容模板
@extends('base')
@section('main')
content
@include('my-other-section-that-has-another-section-declaration-inside')
@overwrite
@section('body.script')
this is an extended script
@stop
body-close 模板
@section('body-open')
this is the original content
@stop
my-other-section-that-has-another-section-declaration-inside 模板
this is cool
@section('body-open')
@parent
this should append to body open.
@stop
这是我的预期结果
<!DOCTYPE html>
<html lang="en">
</head>
<body>
this is the original content
this should append to body open.
content
this is cool
</body>
</html>
但我得到的是这个内容
<!DOCTYPE html>
<html lang="en">
</head>
<body>
this is the original content
content
this is cool
</body>
</html>
请注意,this 应该附加到 body open。 行已被跳过并且不会附加到其预期的部分。
我的代码有问题吗?或者这种方法可行吗?
谢谢!
【问题讨论】: