【发布时间】:2015-12-11 03:36:20
【问题描述】:
我遇到了一个奇怪的刀片问题。
我有一个正在渲染的编辑刀片,但没有使用主刀片。 Debugbar 显示两个视图(主视图和删除视图)都在显示。他们不是!
与master一起使用的其他刀片都可以工作。我尝试复制这些刀片并插入特定数据无济于事。
我已清除浏览器中的历史记录并完成 php artisan cache:clear。什么都没有。
Master Blade 正在处理所有其他渲染。详情如下:
<div class="intro">
<section>
@yield('intro')
</section>
</div>
这个刀片可以工作并且是用master渲染的:
@extends('layouts.master')
@section('title')
Your Profile
@stop
@section('head')
@stop
@section('intro')
<div class="output">
<h2>Your Pets</h2>
<div>
</div>
@if(sizeof($pets) == 0)
No pets
@else
@foreach($pets as $pet)
<div class="p1">
<h3>{{ $pet->petName }}</h3>
<p><img src='{{ $pet->photo }}' width="200px" height="200px"></p>
<p>{{ $pet->breed }}</p>
<a href='/profile/edit/{{$pet->id}}'>Edit</a> |
<a href='/profile/confirm-delete/{{$pet->id}}'>Delete</a>
</div>
@endforeach
@endif
</div>
@stop
@section('body')
@stop
这把刀片渲染但没有主人! Debugbar 说两个视图都在渲染。哈!
@extends('layouts.master')
@section('title')
Delete Your Pet
@stop
@section('head')
@stop
@section('intro')
<div class="output">
<h1>Delete Pet</h1>
<p>
Are you sure you want to delete <em>{{$pets->petName}}</em>?
</p>
<p>
<a href='/profile/delete/{{$pets->id}}'>Yes...</a>
</p>
</div>
@stop
@section('body')
@stop
有人看过吗?
【问题讨论】:
-
使用
@endSection而不是@stop,可能会解决您的问题
标签: laravel