Ejemplo n.º 1
0
 /**
  * BaseController constructor.
  * @param Application $application
  */
 public function __construct(Application $application)
 {
     $this->application = $application;
     $this->setPathBound($application->basePath());
     $this->router = $application->getRouter();
     $this->request = $application->getRequest();
     $this->POST = $this->request->POST();
     $this->GET = $this->request->GET();
     $this->method = $this->request->getHttpMethod();
     $this->baseInit();
 }
Ejemplo n.º 2
0
 /**
  * Parse Request to get Matching Route
  *
  * @param RequestInterface $request
  * @return mixed|null
  * @throws PageNotFoundException
  */
 public function parse(RequestInterface $request)
 {
     //$this->request = $request;
     $method = $request->getHttpMethod();
     $routes = $this->getRoutes($method);
     $route = $this->findRoute($routes, $request);
     $this->setCurrentRoute($route);
     return $route;
 }