PHP Class Neos\Flow\Mvc\View\AbstractView

Inheritance: implements Neos\Flow\Mvc\View\ViewInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
$options array The configuration options of this view
$supportedOptions array Syntax example: array( 'someOptionName' => array('defaultValue', 'some description', 'string'), 'someOtherOptionName' => array('defaultValue', some description', integer), ... )
$variables array View variables and their values

Méthodes publiques

Méthode Description
__construct ( array $options = [] ) Set default options based on the supportedOptions provided
assign ( string $key, mixed $value ) : AbstractView Add a variable to $this->variables.
assignMultiple ( array $values ) : AbstractView Add multiple variables to $this->variables.
canRender ( ControllerContext $controllerContext ) : boolean Tells if the view implementation can render the view for the given context.
createWithOptions ( array $options ) : Neos\Flow\Mvc\View\ViewInterface Factory method to create an instance with given options.
getOption ( string $optionName ) : mixed Get a specific option of this View
setControllerContext ( ControllerContext $controllerContext ) : void Sets the current controller context
setOption ( string $optionName, mixed $value ) : void Set a specific option of this View

Method Details

__construct() public méthode

Set default options based on the supportedOptions provided
public __construct ( array $options = [] )
$options array

assign() public méthode

Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
public assign ( string $key, mixed $value ) : AbstractView
$key string Key of variable
$value mixed Value of object
Résultat AbstractView an instance of $this, to enable chaining

assignMultiple() public méthode

Add multiple variables to $this->variables.
public assignMultiple ( array $values ) : AbstractView
$values array array in the format array(key1 => value1, key2 => value2)
Résultat AbstractView an instance of $this, to enable chaining

canRender() public méthode

By default we assume that the view implementation can handle all kinds of contexts. Override this method if that is not the case.
public canRender ( ControllerContext $controllerContext ) : boolean
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
Résultat boolean TRUE if the view has something useful to display, otherwise FALSE

createWithOptions() public static méthode

Factory method to create an instance with given options.
public static createWithOptions ( array $options ) : Neos\Flow\Mvc\View\ViewInterface
$options array
Résultat Neos\Flow\Mvc\View\ViewInterface

getOption() public méthode

Get a specific option of this View
public getOption ( string $optionName ) : mixed
$optionName string
Résultat mixed

setControllerContext() public méthode

Sets the current controller context
public setControllerContext ( ControllerContext $controllerContext ) : void
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
Résultat void

setOption() public méthode

Set a specific option of this View
public setOption ( string $optionName, mixed $value ) : void
$optionName string
$value mixed
Résultat void

Property Details

$controllerContext protected_oe property

protected ControllerContext,Neos\Flow\Mvc\Controller $controllerContext
Résultat Neos\Flow\Mvc\Controller\ControllerContext

$options protected_oe property

The configuration options of this view
protected array $options
Résultat array

$supportedOptions protected_oe property

Syntax example: array( 'someOptionName' => array('defaultValue', 'some description', 'string'), 'someOtherOptionName' => array('defaultValue', some description', integer), ... )
protected array $supportedOptions
Résultat array

$variables protected_oe property

View variables and their values
See also: assign()
protected array $variables
Résultat array