PHP Класс Neos\Flow\Mvc\View\AbstractView

Наследование: implements Neos\Flow\Mvc\View\ViewInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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

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

Метод Описание
__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

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

__construct() публичный Метод

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

assign() публичный Метод

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
Результат AbstractView an instance of $this, to enable chaining

assignMultiple() публичный Метод

Add multiple variables to $this->variables.
public assignMultiple ( array $values ) : AbstractView
$values array array in the format array(key1 => value1, key2 => value2)
Результат AbstractView an instance of $this, to enable chaining

canRender() публичный Метод

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
Результат boolean TRUE if the view has something useful to display, otherwise FALSE

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

Factory method to create an instance with given options.
public static createWithOptions ( array $options ) : Neos\Flow\Mvc\View\ViewInterface
$options array
Результат Neos\Flow\Mvc\View\ViewInterface

getOption() публичный Метод

Get a specific option of this View
public getOption ( string $optionName ) : mixed
$optionName string
Результат mixed

setControllerContext() публичный Метод

Sets the current controller context
public setControllerContext ( ControllerContext $controllerContext ) : void
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
Результат void

setOption() публичный Метод

Set a specific option of this View
public setOption ( string $optionName, mixed $value ) : void
$optionName string
$value mixed
Результат void

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

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

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

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

The configuration options of this view
protected array $options
Результат array

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

Syntax example: array( 'someOptionName' => array('defaultValue', 'some description', 'string'), 'someOtherOptionName' => array('defaultValue', some description', integer), ... )
protected array $supportedOptions
Результат array

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

View variables and their values
См. также: assign()
protected array $variables
Результат array