/** * This is called by the front web controller to dispatch the request. * * @return */ public function dispatch() { /* testing without mod_rewrite! */ //$request_uri = trim($this->context->getRequest()->getParameter('url', ''), '/'); //DBG::printr($this->context->getRequest()->getParameterHolder()->getAll()); try { $request_uri = $this->request->getPathInfo(); // use routes to determine module, action and url parameters $sf_routing = $this->initializeSymfonyRouting(); $params = $sf_routing->parse($request_uri); // adds request url parameters to request object! $this->request->getParameterHolder()->add($params); // determine our module and action $moduleName = $this->request->getParameter('module'); $actionName = $this->request->getParameter('action'); if (empty($moduleName) || empty($actionName)) { throw new coreError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName)); } $this->forward($moduleName, $actionName); } catch (coreException $e) { $e->printStackTrace(); } catch (Exception $e) { coreException::createFromException($e)->printStackTrace(); } }