Closed Namek closed 9 years ago
For such case in Laravel when we create view with arguments, such us:
View::make('layouts.index')->with('categories', $categories)
have defined layouts/index.blade.php like this:
layouts/index.blade.php
<html><body> <h1>My page title</h1> @include('partials.menu') <section id="page-content> ... </section> </body></html>
and want to use $categories in menu partial:
$categories
menu
@cache('menu', 10) <ul> @foreach ($categories as $category) <li>{{ $category['name'] }}</li> @endforeach </ul> @endcache
the index view didn't pass it's arguments to the menu partial so the commit fixes it. Not sure if it's the best way but it sure works for me.
index
Can you send this to develop and rebase against it?
For such case in Laravel when we create view with arguments, such us:
have defined
layouts/index.blade.php
like this:and want to use
$categories
inmenu
partial:the
index
view didn't pass it's arguments to themenu
partial so the commit fixes it. Not sure if it's the best way but it sure works for me.