/** * Create a new Mvc Event * * This wires-up the various Mvc classes and makes them * available as a convenient package to the application */ public function __construct(Bootstrap $bootstrap) { // $this->stopwatch = new Stopwatch(); // framework config $this->bootstrap = $bootstrap; // path to application root $this->app_dir = $bootstrap->getApplicationDir(); // application config $this->registry = Registry::getInstance(); // controller config $this->controller_map = new ControllerMap($this->app_dir); // incoming request $this->request = Request::createFromGlobals($this->controller_map); // outgoing response $this->response = $this->getNewResponse(); // set default view $controller = $this->request->getControllerName(); $action = $this->request->getParam('action', 'index'); $this->response->setView("{$controller}/{$action}.xsl"); }