A
A
Alexey Lyumanov2017-04-19 11:35:03
Template Engines
Alexey Lyumanov, 2017-04-19 11:35:03

How to properly generate a template in laravel 5.4?

I installed this miracle, and immediately the question arose, and most likely a stupor, how to separate the template into subsystems.
For example:

  • header
  • left_sidebar
  • content
  • right_sidebar
  • footer

Each of these elements has a good internal logic, i.e. includes other subelements. And the template structure usually turns out to be somewhere like this:
  • 1. header
  • 1.1 navbar
  • 1.2search
  • 1.3 phones
  • 1.4 logo
  • 1.5 scripts
  • 1.6 styles
  • 2. left_sidebar
  • 2.1 filters
  • 2.2 banner box etc...
  • 3 content
  • 3.1 content + sort filter and etc...
  • 4 footer
  • 4.1 navbar
  • 4.2 subscribe

Now, for example, when I do Route:get('/', ['as'=>'index', 'uses'=>'[email protected]']); then, according to the idea, the main page template with parameters for the main page should be loaded. Namely, the output of specific modules on the main and subsequent pages is of interest.
I saw that you can do yield and set the parameters passing in the resources/views/index.blade.php file through section.
But here the question is, is it not game for an hour?
Isn't it easier to immediately set positions and then manage these positions from the admin panel (of course, in the future)? Or what is the best way to improve this?
Since I tried to use constructs. view::composer is still some kind of magic for me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anton_lazarev, 2017-04-19
@anton_lazarev

Still, there is a doc, you just need RTFM in more detail, and not the first few lines:
https://laravel.com/docs/5.4/blade

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question