/** * Maps arguments delivered by the request object to the local controller arguments. * * @throws Exception\RequiredArgumentMissingException * @return void */ protected function mapRequestArgumentsToControllerArguments() { if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) { foreach ($this->arguments as $argument) { $argumentName = $argument->getName(); if ($this->request->hasArgument($argumentName)) { $argument->setValue($this->request->getArgument($argumentName)); } elseif ($argument->isRequired()) { throw new \TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set for ' . $this->request->getControllerObjectName() . '->' . $this->request->getControllerActionName() . '.', 1298012500); } } } else { // @deprecated since Extbase 1.4, will be removed two versions after Extbase 6.1 $optionalPropertyNames = array(); $allPropertyNames = $this->arguments->getArgumentNames(); foreach ($allPropertyNames as $propertyName) { if ($this->arguments[$propertyName]->isRequired() === FALSE) { $optionalPropertyNames[] = $propertyName; } } /** @var $validator ArgumentsValidator */ $validator = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentsValidator'); $this->deprecatedPropertyMapper->mapAndValidate($allPropertyNames, $this->request->getArguments(), $this->arguments, $optionalPropertyNames, $validator); $this->argumentsMappingResults = $this->deprecatedPropertyMapper->getMappingResults(); } }
/** * Determines the fully qualified view object name. * * @return mixed The fully qualified view object name or FALSE if no matching view could be found. * @api */ protected function resolveViewObjectName() { $vendorName = $this->request->getControllerVendorName(); if ($vendorName === null) { return false; } $possibleViewName = str_replace(['@vendor', '@extension', '@controller', '@action'], [$vendorName, $this->request->getControllerExtensionName(), $this->request->getControllerName(), ucfirst($this->request->getControllerActionName())], $this->namespacesViewObjectNamePattern); $format = $this->request->getFormat(); $viewObjectName = str_replace('@format', ucfirst($format), $possibleViewName); if (class_exists($viewObjectName) === false) { $viewObjectName = str_replace('@format', '', $possibleViewName); } if (isset($this->viewFormatToObjectNameMap[$format]) && class_exists($viewObjectName) === false) { $viewObjectName = $this->viewFormatToObjectNameMap[$format]; } return class_exists($viewObjectName) ? $viewObjectName : false; }
/** * Determines the fully qualified view object name. * * @return mixed The fully qualified view object name or FALSE if no matching view could be found. * @api */ protected function resolveViewObjectName() { $vendorName = $this->request->getControllerVendorName(); if ($vendorName !== NULL) { $possibleViewName = str_replace('@vendor', $vendorName, $this->namespacesViewObjectNamePattern); } else { $possibleViewName = $this->viewObjectNamePattern; } $possibleViewName = str_replace(array('@extension', '@controller', '@action'), array($this->request->getControllerExtensionName(), $this->request->getControllerName(), ucfirst($this->request->getControllerActionName())), $possibleViewName); $format = $this->request->getFormat(); $viewObjectName = str_replace('@format', ucfirst($format), $possibleViewName); if (class_exists($viewObjectName) === FALSE) { $viewObjectName = str_replace('@format', '', $possibleViewName); } if (isset($this->viewFormatToObjectNameMap[$format]) && class_exists($viewObjectName) === FALSE) { $viewObjectName = $this->viewFormatToObjectNameMap[$format]; } return class_exists($viewObjectName) ? $viewObjectName : FALSE; }
/** * Gets a localized error message * * @return string */ public function getErrorFlashMessage() { $controllerName = strtolower($this->request->getControllerName()); $actionName = strtolower($this->request->getControllerActionName()); return $this->translate('error.' . $controllerName . '.' . $actionName . '.' . $this->accessError, 't3events_reservation'); }