laravel/laravel — pull request #1828 by mexitek (2013-03-29 00:16:56+00:00)
Title: Support for View Composers to handle directories

## View Directory Composers

If you already organize your views within logical directory paths, you should be able to handle composers for those paths.

## Example: Special Data for Mobile Views

```php
// If you want ALL your views in your mobile folder to have specific data attached
View::composer( 'mobile.' , function($view){
$view->nest( 'footer.switch-to-desktop' );
});

```

### Solutions

__Before:__

`View::make( 'mobile.home' )` fired `laravel.composing: mobile.home`

__Now:__

`View::make( 'mobile.home' )` fires `laravel.composing: mobile.` and `laravel.composing: mobile.home`

__Before:__

`View::make( 'mobile.pages.main' )` fired `laravel.composing: mobile.pages.main`

__Now:__

`View::make( 'mobile.pages.main' )` fires `laravel.composing: mobile.`, `laravel.composing: mobile.pages.` and `laravel.composing: mobile.pages.main`