TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Mvc\View\AbstractView Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\View\AbstractView:
TYPO3\CMS\Extbase\Mvc\View\ViewInterface TYPO3\CMS\Extbase\Mvc\View\JsonView TYPO3\CMS\Extbase\Mvc\View\NotFoundView TYPO3\CMS\Install\View\FailsafeView TYPO3\CMS\Install\View\JsonView TYPO3\CMS\Lang\View\AbstractJsonView TYPO3\CMS\Lang\View\Language\ActivateLanguageJson TYPO3\CMS\Lang\View\Language\DeactivateLanguageJson TYPO3\CMS\Lang\View\Language\GetTranslationsJson TYPO3\CMS\Lang\View\Language\UpdateLanguageJson TYPO3\CMS\Lang\View\Language\UpdateTranslationJson

Public Member Functions

 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 assign ($key, $value)
 
 assignMultiple (array $values)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 initializeView ()
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Mvc\View\ViewInterface
 render ()
 

Protected Attributes

 $controllerContext
 
 $variables = []
 

Detailed Description

An abstract View

Definition at line 22 of file AbstractView.php.

Member Function Documentation

◆ assign()

TYPO3\CMS\Extbase\Mvc\View\AbstractView::assign (   $key,
  $value 
)

Add a variable to $this->viewData. Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible

Parameters
string$keyKey of variable
mixed$valueValue of object
Returns
an instance of $this, to enable chaining

Implements TYPO3\CMS\Extbase\Mvc\View\ViewInterface.

Definition at line 58 of file AbstractView.php.

Referenced by TYPO3\CMS\Extbase\Mvc\View\AbstractView\assignMultiple().

◆ assignMultiple()

TYPO3\CMS\Extbase\Mvc\View\AbstractView::assignMultiple ( array  $values)

Add multiple variables to $this->viewData.

Parameters
array$valuesarray in the format array(key1 => value1, key2 => value2).
Returns
an instance of $this, to enable chaining

Implements TYPO3\CMS\Extbase\Mvc\View\ViewInterface.

Definition at line 71 of file AbstractView.php.

References TYPO3\CMS\Extbase\Mvc\View\AbstractView\assign().

◆ canRender()

TYPO3\CMS\Extbase\Mvc\View\AbstractView::canRender ( \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext  $controllerContext)

Tells if the view implementation can render the view for the given context.

By default we assume that the view implementation can handle all kinds of contexts. Override this method if that is not the case.

Parameters
\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext$controllerContext
Returns
bool TRUE if the view has something useful to display, otherwise FALSE

Implements TYPO3\CMS\Extbase\Mvc\View\ViewInterface.

Definition at line 89 of file AbstractView.php.

◆ initializeView()

TYPO3\CMS\Extbase\Mvc\View\AbstractView::initializeView ( )

Initializes this view.

Override this method for initializing your concrete view implementation.

Returns
void

Implements TYPO3\CMS\Extbase\Mvc\View\ViewInterface.

Definition at line 102 of file AbstractView.php.

◆ setControllerContext()

TYPO3\CMS\Extbase\Mvc\View\AbstractView::setControllerContext ( \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext  $controllerContext)

Sets the current controller context

Parameters
\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext$controllerContext
Returns
void

Implements TYPO3\CMS\Extbase\Mvc\View\ViewInterface.

Definition at line 44 of file AbstractView.php.

References TYPO3\CMS\Extbase\Mvc\View\AbstractView\$controllerContext.

Member Data Documentation

◆ $controllerContext

TYPO3\CMS\Extbase\Mvc\View\AbstractView::$controllerContext
protected

◆ $variables

TYPO3\CMS\Extbase\Mvc\View\AbstractView::$variables = []
protected

Definition at line 36 of file AbstractView.php.

Referenced by TYPO3\CMS\Install\View\JsonView\render().