Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blade templating engine syntax issues on Laravel 4

I'm currently starting a project on the beta version of Laravel 4

When i try to use the templating engine some tags work and some doesn't. e.g:

@layout('layouts.master')
@section('container')
    <h1>About US</h1>
@endsection

is displayed as:

@layout('layouts.master')

About US

@endsection

which means that the @section tag is parsed, but the other are referred to as plain text. also if i change the @layout to @include, it does include the template.

Has anyone run into a similar issue? Have there been any syntax changes I'm unaware of?

like image 618
Matanya Avatar asked Dec 31 '12 13:12

Matanya


People also ask

Which is the correct looping syntax in term of blade engine?

The blade templating engine provides loops such as @for, @endfor, @foreach, @endforeach, @while, and @endwhile directives. These directives are used to create the php loop equivalent statements.

Why does Laravel use the blade template engine?

Laravel Blade template engine enables the developer to produce HTML based sleek designs and themes. All views in Laravel are usually built in the blade template. Blade engine is fast in rendering views because it caches the view until they are modified. All the files in resources/views have the extension .

Can I use blade template without Laravel?

Yes you can use it where ever you like.


1 Answers

@layout has been changed to @extends in Laravel 4. Also, @endsection has been changed to @stop

like image 121
TaylorOtwell Avatar answered Nov 04 '22 05:11

TaylorOtwell