thomshouse/escher — Issue #4: Extending Views
Author: thomshouse
Created: 2011-11-03 06:07:13+00:00
State: open
Labels: Feature Request

It would be awesome to create the ability for views to be "extended" along with controller classes.

Example: I want to create a modified version of the "blog" controller.

* The new "myblog" controller would extend the "blog" controller.
* I might modify an action or create a new action, but most functionality would remain the same.
* Similarly, most views could remain the same.

_However, because views are physical files, at present they must be copied into the views folder of the new controller._

The process of "extending" views can be done at the object level by tracing its own class inheritance until it finds the requested view (or hits a stop).

Pseudo-code:

> while (!exists($file) && $class_name != "Controller") {
> $class_name = getParentClass();
> $file = getFilePath($class_name,$plugin_name);
> }