Skip to content

Commit

Permalink
Clarification on accessing data inside a view when passing an array u…
Browse files Browse the repository at this point in the history
…sing the format.
  • Loading branch information
mhein committed Mar 27, 2015
1 parent b084b61 commit 779bb66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions views.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ If you wish, you may pass an array of data as the second parameter to the `view`

$view = view('greetings', $data);

When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ this }}` (assuming `$data['this']` exists).

#### Sharing Data With All Views

Occasionally, you may need to share a piece of data with all views that are rendered by your application. You have several options: the `view` helper, the `Illuminate\Contracts\View\Factory` [contract](/docs/5.0/contracts), or a wildcard [view composer](#view-composers).
Expand Down

0 comments on commit 779bb66

Please sign in to comment.