Escher was a PHP MVC framework developed by Thom Stricklin from 2011-2013. Escher implemented a hybrid of Model2 MVC and PAC architectures and CMS concepts as well as plugins and configuration wizards. Development halted in 2013 in favor of Kohana and later Symfony, which closely aligned to the same design principles as Escher.
Add to controllers a protected function $this->dispatch() that will route subrequests to another controller. Arguments could take the following format:
...where $subcontroller is a string of the (hookable) name of the subcontroller, args is an array of arguments to pass to the subcontroller, options is an associative array of options to provide the subcontroller, and display is a boolean determining whether the function should return rendered results (default) or display and exit.
An example of dispatching actions to a $subcontroller would be:
I'm still debating as to whether or not there's a better way to handle $options, whether $display is necessary, or whether dispatch() should be split into multiple functions. Part of me thinks $options is a good thing, but might result in some changes in other places (e.g. $route->instance_id). Now taking suggestions! :)
Add to controllers a protected function
$this->dispatch()
that will route subrequests to another controller. Arguments could take the following format:...where
$subcontroller
is a string of the (hookable) name of the subcontroller,args
is an array of arguments to pass to the subcontroller,options
is an associative array of options to provide the subcontroller, anddisplay
is a boolean determining whether the function should return rendered results (default) or display and exit.An example of dispatching actions to a $subcontroller would be:
An example of fetching the result of a dispatched request would be:
I'm still debating as to whether or not there's a better way to handle
$options
, whether$display
is necessary, or whetherdispatch()
should be split into multiple functions. Part of me thinks$options
is a good thing, but might result in some changes in other places (e.g.$route->instance_id
). Now taking suggestions! :)/cc @adetwiler