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
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

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