From a150a7d457f403e6a2ddf2d92a1ebfa3e6a14b10 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 19 Apr 2012 08:37:42 -0500 Subject: [PATCH] allow multiple views to be registered for a single composer. --- laravel/view.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/laravel/view.php b/laravel/view.php index f95b8f33..8a9955dd 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -250,13 +250,18 @@ public static function name($view, $name) * }); * * - * @param string $view - * @param Closure $composer + * @param string|array $view + * @param Closure $composer * @return void */ - public static function composer($view, $composer) + public static function composer($views, $composer) { - Event::listen("laravel.composing: {$view}", $composer); + $views = (array) $views; + + foreach ($views as $view) + { + Event::listen("laravel.composing: {$view}", $composer); + } } /**