简体   繁体   English

Laravel 4 Blade模板无法呈现整个页面

[英]Laravel 4 blade template won't render whole page

I'm running into a weird issue where my page isnt' getting rendered in its entirety. 我遇到了一个奇怪的问题,即我的页面无法完整呈现。 The bottom bit is getting cut off and I'm not sure why. 最底层被切断,我不确定为什么。

I'd paste code, but it's a 3000+ line template im trying to implement. 我会粘贴代码,但这是我尝试实现的3000多个行模板。

I am doing it as follows in dashboard.master: 我在dashboard.master中按如下方式进行操作:

@include('dashboard.master.head')
...
@include('dashboard.master.header')
...
@include('dashboard.master.sidebar')
...
@include('dashboard.master.style_customizer')
...
@include('dashboard.master.page_header')
...
@yield('content')
...tons of lines here

It renders up to content correctly, and awhile after that but it seems to stop at some point. 它可以正确呈现内容,此后不久,但似乎会停止。

example of my blade file calling my master 我的刀片文件调用主服务器的示例

@extends('dashboard.master')
@section('content')
    <p>This is my content</p>
@stop

Edit: I tried removing everything and just pasting the HTML template I have. 编辑:我尝试删除所有内容,然后粘贴我拥有的HTML模板。 It still just stops rendering towards the end of the page. 它仍然只是在页面末尾停止渲染。 So all I have now is literally the master file and the includes in my blade template that calls the master. 因此,我现在所拥有的只是字面上的主文件,以及刀片模板中包含主文件的文件。

In order to show all page, change your last code to : 为了显示所有页面,请将您的最后一个代码更改为:

@extends('dashboard.master')
@section('content')
    <p>This is my content</p>
@show

Laravel will maintain a cache of views that have been accessed, just so that it doesn't have to compile the blade template for each page load. Laravel将维护已访问视图的缓存,以使它不必为每次页面加载都编译刀片模板。 It should be refreshing a particular view should it change, but it sounds like, for some reason, the cache wasn't being refreshed. 应该更改它时应该刷新特定的视图,但是由于某种原因,听起来好像没有刷新缓存。

You can clear the view cache in two different ways: 您可以通过两种不同的方式清除视图缓存:

# Method 1
php artisan cache:clear

# Method 2
rm `ls /path/to/application/app/storage/views | grep -v '.gitignore'`

Reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM