Views and blade templatesΒΆ

There is never any reason to use <?php CODE; ?> syntax for markup. Instead the blade templating syntax of {{ CODE }} should be used. Notice that a semicolon is not needed in the blade syntax. Another difference is echoing: <?php echo "string"; ?> you can drop the echo in blade templating: {{ "string" }}. The same goes for echoing variables: {{ $var }}.

When creating a new page you specify what layout it should use by starting the document with:

@extends('layouts.layoutname') @section('content')

@extends decides what layout is used and @section what/where content gets rendered in the layout. You can define multiple @sections and place them in different locations in your layout. Same goes for views, structure your code into different sections if you wish. You can for example have a page that modifies something in the header of footer, in such case sections would be of good use.

If you need to render out (echo) a view: use View::make('view_name'). Consider using sections or nesting in your routes. Depending on the situtation any of these might be superior, but View::make('view_name') is always a good fallback.