示例#1
0
 /**
  * Resolve the request
  *
  * @param DispatcherContext $context A dispatcher context object
  * @throw DispatcherExceptionMethodNotAllowed If the HTTP request method is not allowed.
  */
 protected function _resolveRequest(DispatcherContext $context)
 {
     //Resolve the controller action
     $method = strtolower($context->request->getMethod());
     if (!in_array($method, $this->getHttpMethods())) {
         throw new DispatcherExceptionMethodNotAllowed('Method ' . strtoupper($method) . ' not allowed');
     }
     $this->setControllerAction($method);
     parent::_resolveRequest($context);
 }
示例#2
0
 /**
  * Resolve the request
  *
  * @param DispatcherContext $context A dispatcher context object
  */
 protected function _resolveRequest(DispatcherContext $context)
 {
     if ($controller = ObjectConfig::unbox($context->param)) {
         $url = $this->getObject('lib:http.url', array('url' => $controller));
         //Set the request query
         $context->request->query->clear()->add($url->getQuery(true));
         //Set the controller
         $identifier = $url->toString(HttpUrl::BASE);
         $identifier = $this->getIdentifier($identifier);
         $this->setController($identifier);
     }
     parent::_resolveRequest($context);
 }