interface ViewInterface (View source)

Interface of a view

Methods

assign(string $key, mixed $value)

Add a variable to the view data collection.

assignMultiple(array $values)

Add multiple variables to the view data collection

StreamInterface
render()

Renders the view

static ViewInterface
createWithOptions(array $options)

Factory method to create an instance with given options.

Details

ViewInterface assign(string $key, mixed $value)

Add a variable to the view data collection.

Can be chained: $this->view->assign(..., ...)->assign(..., ...);

Parameters

string $key

Key of variable

mixed $value

Value of object

Return Value

ViewInterface

for chaining

ViewInterface assignMultiple(array $values)

Add multiple variables to the view data collection

Parameters

array $values

associative array with the key being its name

Return Value

ViewInterface

for chaining

StreamInterface render()

Renders the view

Return Value

StreamInterface

static ViewInterface createWithOptions(array $options)

Factory method to create an instance with given options.

Parameters

array $options

Return Value

ViewInterface