public function __construct(\Micro\ControllerInterface $handler) { $this->handler = $handler; $msg = sprintf("Handler for URI '%s' produced an invalid return, should be a Response", $handler->uri()); parent::__construct($msg); }
public function match(\Micro\Request $request, \Micro\ControllerInterface $controller) { return in_array($request->getMethod(), $controller->methods()); }
/** * Gathers custom parameters from a URL based on the conditions given by * the Controller. * * @param \Micro\ControllerInterface $controller * @param \Micro\Request $request * @return void */ protected function addParameters(ControllerInterface $controller, Request $request) { $regex = $this->ut->compile($controller->uri(), $controller->conditions()); $params = $this->ut->parameters($regex, $request->getPathInfo()); $request->request->add($params); }
public function match(\Micro\Request $request, \Micro\ControllerInterface $controller) { $ut = $this->ut; $regex = $ut->compile($controller->uri(), $controller->conditions()); return $ut->match($regex, $request->getPathInfo()); }
public function match(\Micro\Request $request, \Micro\ControllerInterface $controller) { return $controller->accepts($request); }