chaplinjs/chaplin — pull request #317 by mehcode (2012-12-16 05:10:18+00:00)
Title: View composition and named regions (from gh-233)

Revised version of gh-233.

- `View#regions` is now a declarative hash ala `events`. Thanks to @paulmillr it obeys inheritance with `utils#getPrototypeChain`. If a dervied class registers a named region of the same name as a base class it overwrites the base classes region registration.
```coffeescript
regions:
'#id': 'region1'
'.class': 'region2'
```

- Added `View#registerRegion` and `View#unregisterRegion` to functionally register / unregister regions if neccessary
```coffeescript
initialize: ->
super
@registerRegion '#id', 'region1'
@registerRegion '.class', 'region2'
```

- Changed `!region:apply` to `!region:show`

- Added a convenience method `@compose` on a controller that forwards its parameters to `!composer:compose`.