/** * Processes a general request. The result can be returned by altering the given response. * * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler * @return void * @throws UnsupportedRequestTypeException if the controller doesn't support the current request type * @api */ public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { if (!$this->canProcessRequest($request)) { throw new UnsupportedRequestTypeException(get_class($this) . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701132); } if ($response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response && $request instanceof WebRequest) { $response->setRequest($request); } $this->request = $request; $this->request->setDispatched(true); $this->response = $response; $this->uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class); $this->uriBuilder->setRequest($request); $this->initializeControllerArgumentsBaseValidators(); $this->mapRequestArgumentsToControllerArguments(); $this->controllerContext = $this->buildControllerContext(); }
/** * Handles a request. The result output is returned by altering the given response. * * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler * * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException * @return void */ public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { if (!$this->canProcessRequest($request)) { throw new \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException(get_class($this) . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701131); } if ($response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response) { $response->setRequest($request); } $this->request = $request; $this->request->setDispatched(TRUE); $this->response = $response; $this->uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder'); $this->uriBuilder->setRequest($request); $this->actionMethodName = $this->resolveActionMethodName(); $this->initializeActionMethodArguments(); $this->initializeActionMethodValidators(); $this->mvcPropertyMappingConfigurationService->initializePropertyMappingConfigurationFromRequest($request, $this->arguments); $this->initializeAction(); $actionInitializationMethodName = 'initialize' . ucfirst($this->actionMethodName); if (method_exists($this, $actionInitializationMethodName)) { call_user_func(array($this, $actionInitializationMethodName)); } $this->mapRequestArgumentsToControllerArguments(); $this->checkRequestHash(); $this->controllerContext = $this->buildControllerContext(); $this->view = $this->resolveView(); if ($this->view !== NULL) { $this->initializeView($this->view); } $this->callActionMethod(); }