Skip to content

Commit

Permalink
Update views.md
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 6, 2017
1 parent 5430f57 commit bd98b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views.md
Expand Up @@ -47,9 +47,9 @@ If you need to determine if a view exists, you may use the `View` facade. The `e

As you saw in the previous examples, you may pass an array of data to views:

return view('greetings', $data);
return view('greetings', ['name' => 'Victoria']);

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 its corresponding key, such as `<?php echo $key; ?>`. As an alternative to passing a complete array of data to the `view` helper function, you may use the `with` method to add individual pieces of data to the view:
When passing information in this manner, the data should be an array with key / value pairs. Inside your view, you can then access each value using its corresponding key, such as `<?php echo $key; ?>`. As an alternative to passing a complete array of data to the `view` helper function, you may use the `with` method to add individual pieces of data to the view:

return view('greeting')->with('name', 'Victoria');

Expand Down

0 comments on commit bd98b22

Please sign in to comment.