thomshouse-escher / escher

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.
http://git.io/escher
4 stars 1 forks source link

Account for dispatch routers in main router. #90

Closed thomshouse closed 11 years ago

thomshouse commented 11 years ago

Currently, dispatches do create a special router that is passed to the dispatched controller. However, code in other places do not have access to the dispatch router, and will attempt to use the main router (i.e. Load::Router()).

Perhaps the best approach to account for this is to create a "dispatch stack" in the main router. If the stack is non-empty, the main router will similarly dispatch function calls to the most recently added router in the stack.

Example:

function dispatch(...) {
    ...
    $this->router->addDispatch($dispatchRouter);
    // dispatch logic occurs here
    $this->router->removeDispatch();
}
thomshouse commented 11 years ago

This was fixed in 8d8076f.