@extends('layout')laravel.刀片模板系统似乎无法正常工作 [英] @extends('layout') laravel. Blade Template System seems like Not working

查看:50
本文介绍了@extends('layout')laravel.刀片模板系统似乎无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用laravel的模板系统: blade ,但是在文件 users.blade.php 中使用以下代码时,似乎无法正常工作:

I tried to use the laravel's template system: blade but seems like not working when using the code below in the file users.blade.php:

@extends('layout')

@section('content')
Users! @stop

和浏览器

 @extends('layout')

推荐答案

如果您在/app/views/layout.blade.php中包含一个包含

That should work if you have a template file at /app/views/layout.blade.php that contains

<p>Some content here</p>

@yield('content')

<p>Some additional content here</p>

然后在您的/app/views/user.blade.php中,显示内容

Then in your /app/views/user.blade.php, the content

@extends('layout')

@section('content')

<p>This is the user content</p>

@stop

如果您调用 return View :: make('user'),则应具有已编译的内容

If you call return View::make('user') you should have the compiled content

<p>Some content here</p>

<p>This is the user content</p>

<p>Some additional content here</p>

我希望这可以帮助您澄清问题.如果没有,您可以提供模板文件的位置和相关内容吗?

I hope that helps clarify things for you. If not, can you provide your template file locations and the relevant content?

这篇关于@extends('layout')laravel.刀片模板系统似乎无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆