Skip to content

Commit b696300

Browse files
author
Maxime Dizerens
committed
Add the "share" method with a quick example.
1 parent 367f5c5 commit b696300

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

views/home.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ Sometimes you may wish to directly include a view from within another view. You
114114
<div class="content">
115115
<?php echo render('user.profile'); ?>
116116
</div>
117+
118+
#### Share a value everywhere in your application's views
119+
120+
<div class="content">
121+
<?php View::share('key', 'value'); ?>
122+
</div>
117123

118124
It is also very common to have a partial view that is responsible for display an instance of data in a list. For example, you may create a partial view responsible for displaying the details about a single order. Then, for example, you may loop through an array of orders, rendering the partial view for each order. This is made simpler using the **render_each** helper:
119125

0 commit comments

Comments
 (0)