Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@extends('layout') laravel. Blade Template System seems like Not working

Tags:

php

laravel

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

and browser,

 @extends('layout')
like image 431
Luillyfe Avatar asked Jan 30 '14 14:01

Luillyfe


1 Answers

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>

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

@extends('layout')

@section('content')

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

@stop

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?

like image 124
iavery Avatar answered Oct 04 '22 10:10

iavery