PHP Класс Neos\Flow\Mvc\Controller\ActionController

The action specified in the given ActionRequest is dispatched to a method in the concrete controller whose name ends with "*Action". If no matching action method is found, the action specified in $errorMethodName is invoked. This controller also takes care of mapping arguments found in the ActionRequest to the corresponding method arguments of the action method. It also invokes validation for these arguments by invoking the Property Mapper. By defining media types in $supportedMediaTypes, content negotiation based on the browser's Accept header and additional routing configuration is used to determine the output format the controller should return. Depending on the action being called, a fitting view - determined by configuration - will be selected. By specifying patterns, custom view classes or an alternative controller / action to template path mapping can be defined.
Наследование: extends AbstractController
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$actionMethodName string Name of the action method
$defaultViewImplementation string
$defaultViewObjectName string The default view object to use if none of the resolved views can render a response for the current request.
$errorMethodName string Name of the special error action method which is called in case of errors
$mvcPropertyMappingConfigurationService MvcPropertyMappingConfigurationService
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$reflectionService Neos\Flow\Reflection\ReflectionService
$settings array
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$view Neos\Flow\Mvc\View\ViewInterface The current view, as resolved by resolveView()
$viewConfigurationManager Neos\Flow\Mvc\ViewConfigurationManager
$viewFormatToObjectNameMap array Example: array('html' => 'MyCompany\MyApp\MyHtmlView', 'json' => 'MyCompany\...
$viewObjectNamePattern string Pattern after which the view object name is built if no format-specific view could be resolved.

Открытые методы

Метод Описание
getActionIgnoredValidationArguments ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
getActionMethodParameters ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array Returns a map of action method names and their parameters.
getActionValidateAnnotationData ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array Returns a map of action method names and their validation parameters.
getActionValidationGroups ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array Returns a map of action method names and their validation groups.
getPublicActionMethods ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
injectSettings ( array $settings ) : void
processRequest ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response ) : void Handles a request. The result output is returned by altering the given response.

Защищенные методы

Метод Описание
addErrorFlashMessage ( ) : void If an error occurred during this request, this adds a flash message describing the error to the flash message container.
callActionMethod ( ) : void Calls the specified action method and passes the arguments.
errorAction ( ) : string A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.
forwardToReferringRequest ( ) : void If information on the request before the current request was sent, this method forwards back to the originating request. This effectively ends processing of the current request, so do not call this method before you have finished the necessary business logic!
getErrorFlashMessage ( ) : Neos\Error\Messages\Message A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.
getFlattenedValidationErrorMessage ( ) : string Returns a string containing all validation errors separated by PHP_EOL.
getInformationNeededForInitializeActionMethodValidators ( ) : array This is a helper method purely used to make initializeActionMethodValidators() testable without mocking static methods.
handleTargetNotFoundError ( ) : void Checks if the arguments validation result contain errors of type TargetNotFoundError and throws a TargetNotFoundException if that's the case for a top-level object.
initializeAction ( ) : void Initializes the controller before invoking an action method.
initializeActionMethodArguments ( ) : void Implementation of the arguments initialization in the action controller: Automatically registers arguments of the current action
initializeActionMethodValidators ( ) : void Adds the needed validators to the Arguments:
initializeView ( Neos\Flow\Mvc\View\ViewInterface $view ) : void Initializes the view before invoking an action method.
resolveActionMethodName ( ) : string Resolves and checks the current action method name
resolveView ( ) : Neos\Flow\Mvc\View\ViewInterface Prepares a view for the current action and stores it in $this->view.
resolveViewObjectName ( ) : mixed Determines the fully qualified view object name.

Описание методов

addErrorFlashMessage() защищенный метод

If an error occurred during this request, this adds a flash message describing the error to the flash message container.
protected addErrorFlashMessage ( ) : void
Результат void

callActionMethod() защищенный метод

If the action returns a string, it is appended to the content in the response object. If the action doesn't return anything and a valid view exists, the view is rendered automatically.
protected callActionMethod ( ) : void
Результат void

errorAction() защищенный метод

The default implementation checks for TargetNotFoundErrors, sets a flash message, request errors and forwards back to the originating action. This is suitable for most actions dealing with form input.
protected errorAction ( ) : string
Результат string

forwardToReferringRequest() защищенный метод

If information on the request before the current request was sent, this method forwards back to the originating request. This effectively ends processing of the current request, so do not call this method before you have finished the necessary business logic!
protected forwardToReferringRequest ( ) : void
Результат void

getActionIgnoredValidationArguments() публичный статический метод

public static getActionIgnoredValidationArguments ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат array Array of argument names as key by action method name

getActionMethodParameters() публичный статический метод

Returns a map of action method names and their parameters.
public static getActionMethodParameters ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат array Array of method parameters by action name

getActionValidateAnnotationData() публичный статический метод

Returns a map of action method names and their validation parameters.
public static getActionValidateAnnotationData ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат array Array of validate annotation parameters by action method name

getActionValidationGroups() публичный статический метод

Returns a map of action method names and their validation groups.
public static getActionValidationGroups ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат array Array of validation groups by action method name

getErrorFlashMessage() защищенный метод

A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.
protected getErrorFlashMessage ( ) : Neos\Error\Messages\Message
Результат Neos\Error\Messages\Message The flash message or FALSE if no flash message should be set

getFlattenedValidationErrorMessage() защищенный метод

Returns a string containing all validation errors separated by PHP_EOL.
protected getFlattenedValidationErrorMessage ( ) : string
Результат string

getInformationNeededForInitializeActionMethodValidators() защищенный метод

This is a helper method purely used to make initializeActionMethodValidators() testable without mocking static methods.

getPublicActionMethods() публичный статический метод

public static getPublicActionMethods ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат array Array of all public action method names, indexed by method name

handleTargetNotFoundError() защищенный метод

You can override this method (or the errorAction()) if you need a different behavior
protected handleTargetNotFoundError ( ) : void
Результат void

initializeAction() защищенный метод

Override this method to solve tasks which all actions have in common.
protected initializeAction ( ) : void
Результат void

initializeActionMethodArguments() защищенный метод

Don't override this method - use initializeAction() instead.
См. также: initializeArguments()
protected initializeActionMethodArguments ( ) : void
Результат void

initializeActionMethodValidators() защищенный метод

- Validators checking the data type from the @param annotation - Custom validators specified with validate annotations. - Model-based validators (validate annotations in the model) - Custom model validator classes
protected initializeActionMethodValidators ( ) : void
Результат void

initializeView() защищенный метод

Override this method to solve assign variables common for all actions or prepare the view in another way before the action is called.
protected initializeView ( Neos\Flow\Mvc\View\ViewInterface $view ) : void
$view Neos\Flow\Mvc\View\ViewInterface The view to be initialized
Результат void

injectSettings() публичный метод

public injectSettings ( array $settings ) : void
$settings array
Результат void

processRequest() публичный метод

Handles a request. The result output is returned by altering the given response.
public processRequest ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response ) : void
$request Neos\Flow\Mvc\RequestInterface The request object
$response Neos\Flow\Mvc\ResponseInterface The response, modified by this handler
Результат void

resolveActionMethodName() защищенный метод

Resolves and checks the current action method name
protected resolveActionMethodName ( ) : string
Результат string Method name of the current action

resolveView() защищенный метод

By default, this method tries to locate a view with a name matching the current action.
protected resolveView ( ) : Neos\Flow\Mvc\View\ViewInterface
Результат Neos\Flow\Mvc\View\ViewInterface the resolved view

resolveViewObjectName() защищенный метод

Determines the fully qualified view object name.
protected resolveViewObjectName ( ) : mixed
Результат mixed The fully qualified view object name or FALSE if no matching view could be found.

Описание свойств

$actionMethodName защищенное свойство

Name of the action method
protected string $actionMethodName
Результат string

$defaultViewImplementation защищенное свойство

protected string $defaultViewImplementation
Результат string

$defaultViewObjectName защищенное свойство

The default view object to use if none of the resolved views can render a response for the current request.
protected string $defaultViewObjectName
Результат string

$errorMethodName защищенное свойство

Name of the special error action method which is called in case of errors
protected string $errorMethodName
Результат string

$mvcPropertyMappingConfigurationService защищенное свойство

protected MvcPropertyMappingConfigurationService,Neos\Flow\Mvc\Controller $mvcPropertyMappingConfigurationService
Результат MvcPropertyMappingConfigurationService

$objectManager защищенное свойство

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

$reflectionService защищенное свойство

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

$settings защищенное свойство

protected array $settings
Результат array

$systemLogger защищенное свойство

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Результат Neos\Flow\Log\SystemLoggerInterface

$view защищенное свойство

The current view, as resolved by resolveView()
protected ViewInterface,Neos\Flow\Mvc\View $view
Результат Neos\Flow\Mvc\View\ViewInterface

$viewConfigurationManager защищенное свойство

protected ViewConfigurationManager,Neos\Flow\Mvc $viewConfigurationManager
Результат Neos\Flow\Mvc\ViewConfigurationManager

$viewFormatToObjectNameMap защищенное свойство

Example: array('html' => 'MyCompany\MyApp\MyHtmlView', 'json' => 'MyCompany\...
protected array $viewFormatToObjectNameMap
Результат array

$viewObjectNamePattern защищенное свойство

Pattern after which the view object name is built if no format-specific view could be resolved.
protected string $viewObjectNamePattern
Результат string