ViewInterface
interface ViewInterface (View source)
Interface of a view
Methods
void
assign(string $key, mixed $value)
Add a variable to the view data collection.
assignMultiple(array $values)
Add multiple variables to the view data collection
bool
canRender(ControllerContext $controllerContext)
Tells if the view implementation can render the view for the given context.
string|ActionResponse|ResponseInterface|StreamInterface|object
render()
Renders the view
static ViewInterface
createWithOptions(array $options)
Factory method to create an instance with given options.
Details
void
setControllerContext(ControllerContext $controllerContext)
Sets the current controller context
ViewInterface
assign(string $key, mixed $value)
Add a variable to the view data collection.
Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
ViewInterface
assignMultiple(array $values)
Add multiple variables to the view data collection
bool
canRender(ControllerContext $controllerContext)
Tells if the view implementation can render the view for the given context.
string|ActionResponse|ResponseInterface|StreamInterface|object
render()
Renders the view
static ViewInterface
createWithOptions(array $options)
Factory method to create an instance with given options.