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

Hi David,

I think I have a project in a Laravel 4 version.

I use subviews frequently when paging things and then using ajax to replace the complete subview part.

Here you can see the controller, which inserts a page of the item list into the index view as a subview. I used blade templating (@section), but you can ignore that part. The important thing is that you can pass the subview(s) as variable(s) into the containing view and then cast them to string(s). I the provided examples the cast is implicit and occurs after

{{ $list }}

is expanded to

echo $list

.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.