View

Coordinates rendering of the data produced by an action.

see
see

Methods

Initialize a view object.

__construct(string $contentType) 

Arguments

$contentType

string

The content type to assign to the view.

Render the data produced by an action.

render(array $data) : string

Arguments

$data

array

The data produced by an action.

Response

string

Create a view instance based on a view specification.

make(string $name, string $contentType) : \HotMelt\View
static final

Arguments

$name

string

Class or template name of the view to create. If no class by this name exists, an instance of \HotMelt\TemplateView will be returned.

$contentType

string

The content type to assign to the view.

Response

\HotMelt\View

Properties

HTTP response headers for the view. Prepopulated with a `Content-Type` header as specified when initializing the view.

headers : 
type

array

HTTP status code for the view. Defaults to `200`.

statusCode : 
type

int