Laravel View

View::make('path/to/view');
View::make('foo/bar')->with('key', 'value');
View::make('foo/bar')->withKey('value');
View::make('foo/bar', array('key' => 'value'));
View::exists('foo/bar');

Share a value across all views

View::share('key', 'value');

Nesting views

View::make('foo/bar')->nest('name', 'foo/baz', $data);

Register a view composer

View::composer('viewname', function($view){});

Register multiple views to a composer

View::composer(array('view1', 'view2'), function($view){});

Register a composer class

View::composer('viewname', 'FooComposer');
View::creator('viewname', function($view){});

Leave a Reply

Your email address will not be published. Required fields are marked *