Support the ongoing development of Laravel.io →
posted 10 years ago
Views Blade
Last updated 2 years ago.
0

You won't find too much informations about Blade sadly. You can look here, maybe you will find some info:

http://culttt.com/2014/03/03/model-presenters-laravel-4/

About $this->layout. It works that way so you specify it in your controller eg $this->layout = 'layouts.frontend'. Then in your layouts.frontend view you can specify @yield('content') tag in somewhere(most likely in content block of page). And in your controller method you can use

protected $layout = 'layouts.frontend';
public function someRoute(){
    $view = \View::make('auth.login'); //this is partial view
    $this->layout->content = $view; //here you inject this part view to layout 'content' section
}

There are many approaches to templating, but I use 3 layers(learnt from Symfony 2). You have master layout, then some more specific layout like layout.frontend which extends your master layout, then you have specific pages like profile view which gets injected into your frontend layout. This way you are flexible about what you want to have in views. Code above is one of methods of extending layout. The other way is using @extends('layouts.frontend') which will do the same job.

Last updated 2 years ago.
0

Also learned about blade and layouts this make me work on layouts. you can easily makes your layout using blade http://tutsnare.com/create-layout-in-laravel-using-blade-templating/ A fully structured layouts tutorial i found.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mvilera mvilera Joined 15 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.