composers.php 1.21 KB
Newer Older
1 2 3 4 5 6
<?php

return array(

	/*
	|--------------------------------------------------------------------------
7
	| View Names & Composers
8 9
	|--------------------------------------------------------------------------
	|
10 11
	| Named views give you beautiful syntax when working with your views.
	|
12 13 14 15 16 17
	| Here's how to define a named view:
	|
	|		'home.index' => array('name' => 'home')
	|
	| Now, you can create an instance of that view using the expressive View::of
	| dynamic method. Take a look at this example:
18
	|
19
	|		return View::of_layout();
20
	|
21 22 23 24 25
	| View composers provide a convenient way to add common elements to a view
	| each time it is created. For example, you may wish to bind a header and
	| footer partial each time the view is created.
	|
	| The composer will receive an instance of the view being created, and is
26 27 28 29 30 31 32 33
	| free to modify the view however you wish. Here is how to define one:
	|
	|		'home.index' => function($view)
	|		{
	|			//
	|		}
	|
	| Of course, you may define a view name and a composer for a single view:
34
	|
35 36 37 38
	|		'home.index' => array('name' => 'home', function($view)
	|		{
	|			//
	|		})	
39 40 41
	|
	*/

42
	'home.index' => array('name' => 'home', function($view)
43
	{
44
		// This composer is called for the "home.index" view.
45
	}),
46 47

);