allow multiple views to be registered for a single composer.

This commit is contained in:
Taylor Otwell 2012-04-19 08:37:42 -05:00
parent d1428948ea
commit a150a7d457
1 changed files with 9 additions and 4 deletions

View File

@ -250,13 +250,18 @@ public static function name($view, $name)
* }); * });
* </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)
{ {
Event::listen("laravel.composing: {$view}", $composer); $views = (array) $views;
foreach ($views as $view)
{
Event::listen("laravel.composing: {$view}", $composer);
}
} }
/** /**