Templates for Laravel

1

I'm starting a system that will be the foundation of all company systems.

The system will develop in Laravael 4 and the interface will be a theme of wrapbootstrap .

What would be the best practices for using my library / package layout for my future projects?

    
asked by anonymous 02.10.2014 / 03:40

2 answers

2

I've already done what you're doing a few times and in my case I think I'd better get the whole theme chopped up, every matching piece there is some element of the layout (header, footer, sidebar etc.) so it's best to reuse only using @include ('') then most of the time my structure looks like this:

views
--layouts
----master.blade.php(estrutura do html)
----partials
------sidebar.blade.php
------header.blade.php
------footer.blade.php
------styles.blade.php
------scripts.blade.php
------navigation.blade.php
------alerts.blade.php
    
02.10.2014 / 03:56
0

What I solved:

Following the idea of Richard follows my structure:

views
--layouts
----master.blade.php(estrutura do html)
----sections (alteração minha)
------sidebar.blade.php
------header.blade.php
------footer.blade.php
------styles.blade.php
------scripts.blade.php
------navigation.blade.php
------content.blade.php (será usado para carregar a view que a rota definir)
------alerts.blade.php

My final question was whether you could define a template for a controller instead of using USE in each view. Here is the answer to my question:

link

class UserController extends BaseController {

/**
 * The layout that should be used for responses.
 */
protected $layout = 'layouts.master';

/**
 * Show the user profile.
 */
public function showProfile()
{
    $this->layout->content = View::make('user.profile');
}

}

Thanks guys.

    
02.10.2014 / 18:21