我尝试使用 laravel 的模板系统:blade
但在文件 users.blade.php
中使用以下代码时似乎无法正常工作:
@extends('layout')
@section('content')
Users! @stop
和浏览器,
@extends('layout')
最佳答案
如果你在/app/views/layout.blade.php 有一个包含
<p>Some content here</p>
@yield('content')
<p>Some additional content here</p>
然后在你的/app/views/user.blade.php,内容
@extends('layout')
@section('content')
<p>This is the user content</p>
@stop
如果你调用return View::make('user')
你应该有编译后的内容
<p>Some content here</p>
<p>This is the user content</p>
<p>Some additional content here</p>
我希望这能帮助您澄清事情。如果没有,能否提供模板文件位置和相关内容?
关于php - @extends ('layout' ) laravel。 Blade 模板系统似乎无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21458885/