PHP Interface Neos\Flow\Mvc\View\ViewInterface

Exibir arquivo Open project: neos/flow-development-collection Interface Usage Examples

Public Methods

Method Description
assign ( string $key, mixed $value ) : Neos\Flow\Mvc\View\ViewInterface Add a variable to the view data collection.
assignMultiple ( array $values ) : Neos\Flow\Mvc\View\ViewInterface Add multiple variables to the view data collection
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.
render ( ) : string Renders the view
setControllerContext ( ControllerContext $controllerContext ) : void Sets the current controller context

Method Details

assign() public method

Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
public assign ( string $key, mixed $value ) : Neos\Flow\Mvc\View\ViewInterface
$key string Key of variable
$value mixed Value of object
return Neos\Flow\Mvc\View\ViewInterface an instance of $this, to enable chaining

assignMultiple() public method

Add multiple variables to the view data collection
public assignMultiple ( array $values ) : Neos\Flow\Mvc\View\ViewInterface
$values array array in the format array(key1 => value1, key2 => value2)
return Neos\Flow\Mvc\View\ViewInterface an instance of $this, to enable chaining

canRender() public method

Tells if the view implementation can render the view for the given context.
public canRender ( ControllerContext $controllerContext ) : boolean
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
return boolean TRUE if the view has something useful to display, otherwise FALSE

createWithOptions() public static method

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

render() public method

Renders the view
public render ( ) : string
return string The rendered view

setControllerContext() public method

Sets the current controller context
public setControllerContext ( ControllerContext $controllerContext ) : void
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext Context of the controller associated with this view
return void