TemplateView

Extends \HotMelt\View

Provides support for views using the Twig template engine.

link

Twig Project Website

Methods

Initialize a view object.

__construct(string $contentType) 
inherited

Arguments

$contentType

string

The content type to assign to the view.

Return the Twig environment used by `\HotMelt\TemplateView` objects.

twig() : \Twig_Environment
static

Response

\Twig_Environment

Render the data produced by an action.

render(array $data) : string
inherited

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
inherited 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 : 
inherited
type

array

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

statusCode : 
inherited
type

int