thomshouse/escher — Issue #9: Add the ability to specify subcontrollers as a parameter of a controller.
Author: thomshouse
Created: 2011-11-30 17:50:53+00:00
State: open
Labels: Feature Request

Right now, it's a bit cumbersome to implement HMVC. Specifying subcontrollers that can be dealt with directly by the execute() function would be a nice addition.

```php
class Controller_blog extends Controller {
protected $subcontrollers = array(
'comments' => 'comments',
'ratings' => array('plugin','ratings'),
);
```

The execute() function would look for the presence of $arg[0] as an array key in $this->subcontrollers, and if present load the correct controller and pass the remaining args on to its own execution.

There could even be a hook for adding subcontrollers, although the usefulness might be limited without deeper functionality.