我尝试使用laravel的模板系统:blade
但在文件中使用以下代码时似乎无法正常工作users.blade.php
:
@extends('layout')
@section('content')
Users! @stop
Run Code Online (Sandbox Code Playgroud)
和浏览器,
@extends('layout')
Run Code Online (Sandbox Code Playgroud)
如果您在/app/views/layout.blade.php中包含模板文件,那么这应该有用
<p>Some content here</p>
@yield('content')
<p>Some additional content here</p>
Run Code Online (Sandbox Code Playgroud)
然后在你的/app/views/user.blade.php中,内容
@extends('layout')
@section('content')
<p>This is the user content</p>
@stop
Run Code Online (Sandbox Code Playgroud)
如果你打电话,return View::make('user')
你应该有编译的内容
<p>Some content here</p>
<p>This is the user content</p>
<p>Some additional content here</p>
Run Code Online (Sandbox Code Playgroud)
我希望这有助于为您澄清事情.如果没有,您能提供模板文件位置和相关内容吗?