Browse Source

Added documentation for the @render() Blade method

Signed-off-by: Jakobud <jake.e.wilson@gmail.com>
Jakobud 12 years ago
parent
commit
7475bcd348
1 changed files with 9 additions and 6 deletions
  1. 9 6
      laravel/documentation/views/templating.md

+ 9 - 6
laravel/documentation/views/templating.md

@@ -64,18 +64,21 @@ Blade makes writing your views pure bliss. To create a blade view, simply name y
 #### Echoing a variable using Blade:
 #### Echoing a variable using Blade:
 
 
 	Hello, {{$name}}.
 	Hello, {{$name}}.
-	
+
 #### Echoing function results using Blade:
 #### Echoing function results using Blade:
 
 
 	{{ Asset::styles() }}
 	{{ Asset::styles() }}
 
 
-#### Rendering a view:
+#### Render a view:
 
 
-	<h1>Profile</hi>
+You can use **@include** to render a view into another view. The rendered view will automatically inherit all of the data from the current view.
 
 
+	<h1>Profile</hi>
 	@include('user.profile')
 	@include('user.profile')
 
 
-> **Note:** When using the **@include** Blade expression, the view will automatically inherit all of the current view data.
+Similarly, you can use **@render**, which behaves the same as **@include** except the rendered view will **not** inherit the data from the current view.
+
+	@render('admin.list')
 
 
 #### Creating loops using Blade:
 #### Creating loops using Blade:
 
 
@@ -124,7 +127,7 @@ Blade makes writing your views pure bliss. To create a blade view, simply name y
 
 
 <a name="blade-comments"></a>
 <a name="blade-comments"></a>
 #### Blade comments:
 #### Blade comments:
-	
+
 	@if ($check)
 	@if ($check)
 		{{-- This is a comment --}}
 		{{-- This is a comment --}}
 		...
 		...
@@ -179,4 +182,4 @@ Sometimes you may want to only append to a section of a layout rather than overw
 		Welcome to the profile page!
 		Welcome to the profile page!
 	@endsection
 	@endsection
 
 
-Notice the **@parent** Blade construct? It will be replaced with the contents of the layout's navigation section, providing you with a beautiful and powerful method of performing layout extension and inheritance.
+Notice the **@parent** Blade construct? It will be replaced with the contents of the layout's navigation section, providing you with a beautiful and powerful method of performing layout extension and inheritance.