How to view multiple content on @Yield from Laravel’s Blade template system?

Asked

Viewed 179 times

0

Well, I have a site in progress in the programming language of Laravel. In my welcome.blade.php I created a @yield so-called sides

inserir a descrição da imagem aqui

After the creation of that yield, created the folders in my directory: resources/views/sides/homepage and put my files apart into three .php

inserir a descrição da imagem aqui

With the creation of these files I added the following command line:

@extends('welcome')

@section('sider')
    meu conteúdo
@stop

in each of them, now I would like to know how to call the three files separately within a single yield by entering the page.

  • 1

    It’s a mixture of sides and sider I even got dizzy, but, like this, if each file is a template that extends from welcome, how do you want to display 3 different layouts? it seems to me that it should not even be yield/section there; a include maybe?

  • Well, I would like to display separately, because when changing page will not be displaying the same side menu always, will change according to my needs. So I want example: Página Inicial - 2 menus, subpages 3 menus diferentes dos das páginas inicial more or less in this sense know ...

  • So your code should already do that; what’s the problem?

  • There you are, why are you separated like this, when I call the @yield he asked me to call on route/web.php I don’t know how to create that call inside the view, 'Cause I can only call one view at a time, for example: return view('sides/homepage/requests') being that I wish to call more or less so: return view('sides/homepage/requests', 'sides/homepage/support') and so on

  • But you want to call one at a time because you want to show off separately, don’t you? It’s getting more and more confusing.

  • Calm down let me see a way I can explain to you without confusion, calm down ...

  • Okay, I think that makes it better for you to understand, look at the outline: https://imgur.com/a/qfrfxKg

  • Exactly. If each page is loaded separately, simply call the respective view.

  • Got it ... Grateful!

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.