Commit a150a7d4 authored by Taylor Otwell's avatar Taylor Otwell

allow multiple views to be registered for a single composer.

parent d1428948
...@@ -250,14 +250,19 @@ class View implements ArrayAccess { ...@@ -250,14 +250,19 @@ class View implements ArrayAccess {
* }); * });
* </code> * </code>
* *
* @param string $view * @param string|array $view
* @param Closure $composer * @param Closure $composer
* @return void * @return void
*/ */
public static function composer($view, $composer) public static function composer($views, $composer)
{
$views = (array) $views;
foreach ($views as $view)
{ {
Event::listen("laravel.composing: {$view}", $composer); Event::listen("laravel.composing: {$view}", $composer);
} }
}
/** /**
* Get the rendered contents of a partial from a loop. * Get the rendered contents of a partial from a loop.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment