I am trying to set up a site using laravel, but I'm really having trouble with basic things that the documentation just doesn't cover.
In this case, I see that it says I can include one view inside another by using @include('view.name')
. What is view.name? Where is it saved? I tried creating a file app/views/view.name.blade.php
, but it wasn't read. How does the file name map to the blade name?
EDIT: Below was the preferred solution in 2014. Nowadays you should use @include
, as mentioned in the other answer.
In Laravel views the dot is used as folder separator. So for example I have this code
return View::make('auth.details', array('id' => $id));
which points to app/views/auth/details.blade.php
And to include a view inside a view you do like this:
file: layout.blade.php
<html>
<html stuff>
@yield('content')
</html>
file: hello.blade.php
@extends('layout')
@section('content')
<html stuff>
@stop