Extbase\MVC\Controller

Class Tx_Extbase_MVC_Controller_ActionController

Extbase\MVC\Controller\Tx_Extbase_MVC_Controller_AbstractController
extended by Extbase\MVC\Controller\Tx_Extbase_MVC_Controller_ActionController

All Implemented Interfaces:


public class Tx_Extbase_MVC_Controller_ActionController
extends Tx_Extbase_MVC_Controller_AbstractController

A multi action controller. This is by far the most common base class for Controllers.

Package: Extbase
Subpackage: MVC\Controller
Version: $ID:$


Field Summary

protected $view
protected string $viewObjectNamePattern
protected string $defaultViewObjectName
protected string $actionMethodName
protected string $errorMethodName

Method Summary

 protected void callActionMethod()
 protected void resolveView()
 protected mixed resolveViewObjectName()
 protected void initializeView($view)
 protected void initializeAction()
 protected string errorAction()

Field Detail

$view

protected $view = NULL

By default a Fluid TemplateView is provided, if a template is available, then a view with the same name as the current action will be looked up.
If none is available the $defaultViewObjectName will be used and finally an EmptyView will be created.


$viewObjectNamePattern

protected string $viewObjectNamePattern = 'Tx_@extension_View_@controller_@action'

Pattern after which the view object name is built if no Fluid template is found.


$defaultViewObjectName

protected string $defaultViewObjectName = NULL

The default view object to use if neither a Fluid template nor an action specific view object could be found.


$actionMethodName

protected string $actionMethodName = 'indexAction'

Name of the action method


$errorMethodName

protected string $errorMethodName = 'errorAction'

Name of the special error action method which is called in case of errors


Method Detail

callActionMethod

protected void callActionMethod()

Calls the specified action method and passes the arguments.

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.

resolveView

protected void resolveView()

Prepares a view for the current action and stores it in $this->view.
By default, this method tries to locate a view with a name matching the current action.

resolveViewObjectName

protected mixed resolveViewObjectName()

Determines the fully qualified view object name.

initializeView

protected void initializeView($view)

Initializes the view before invoking an action method.

Override this method to solve assign variables common for all actions or prepare the view in another way before the action is called.

Parameters

$view - The view to be initialized

initializeAction

protected void initializeAction()

Initializes the controller before invoking an action method.

Override this method to solve tasks which all actions have in common.

errorAction

protected string errorAction()

A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.

The default implementation sets a flash message, request errors and forwards back to the originating action. This is suitable for most actions dealing with form input.