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

Use partials / includes.

0

Can you be more explicit ? I created a view in my files views /

currently, I have :

return view('home.index') ->with('availabilities', $availabilities) ->with('matches', $matches) ->with('users', $users);

Thanks

0

From what I understand you want common HTML in various views, right?

You use a smaller view file with the common HTML you want (like a nav bar) then include that in other views using the blade syntax @include('path.to.view')

Is that what you mean?

0

Yes, but this view also contains data from the database , so, I would have to treat the controller code ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

piep14 piep14 Joined 2 Oct 2015

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.