コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: MethodMatcher.php プロジェクト: rawebone/micro
 public function match(\Micro\Request $request, \Micro\ControllerInterface $controller)
 {
     return in_array($request->getMethod(), $controller->methods());
 }
コード例 #3
0
ファイル: Application.php プロジェクト: rawebone/micro
 /**
  * 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);
 }
コード例 #4
0
ファイル: UrlMatcher.php プロジェクト: rawebone/micro
 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());
 }
コード例 #5
0
ファイル: AcceptsMatcher.php プロジェクト: rawebone/micro
 public function match(\Micro\Request $request, \Micro\ControllerInterface $controller)
 {
     return $controller->accepts($request);
 }