Skip to content

Instantly share code, notes, and snippets.

@allanfreitas
Forked from anonymous/gist:c7019f292ac599900fb2
Last active August 29, 2015 14:01
// controller Ola ,
<?php
class OlaController extends BaseController {
public function showProfile()
{
//
return View::make('ola');
}
}
// a raiz ola
@extends('layout.master')
@section('content')
<h1>Meu teste 2</h1>
@stop
// o layout
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Meu teste no laravel</title>
</head>
@include('layout.header')
@yield ('content')
<body>
</body>
</html>
// controller Ola ,
<?php
class OlaController extends BaseController {
protected $layout = 'layout.master';
public function showProfile()
{
$this->layout->content = View::make('ola');
}
}
//ola.blade.php
<h1>Meu teste 2</h1>
//layout/master.blade.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Meu teste no laravel</title>
</head>
@include('layout.header')
{{$content)}}
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment