class PhpView implements ViewInterface (View source)

Render a view file with php.

Traits

Methods

string
getName()

Get name.

setName(string $name)

Set name.

mixed
getContext(string|null $key = null)

Get context values.

with(string|array $key, mixed $value = null)

Add context values.

static string
getLayoutContent()

Get the top-most layout content from the stack.

string
getFilepath()

Get filepath.

setFilepath(string $filepath)

Set filepath.

getLayout()

Get layout.

setLayout(ViewInterface $layout)

Set layout.

string
toString()

Render the view to a string.

ResponseInterface
toResponse()

Convert to Psr\Http\Message\ResponseInterface.

Details

string getName()

Get name.

Return Value

string

HasNameTrait setName(string $name)

Set name.

Parameters

string $name

Return Value

HasNameTrait $this

mixed getContext(string|null $key = null)

Get context values.

Parameters

string|null $key

Return Value

mixed

HasContextTrait with(string|array $key, mixed $value = null)

Add context values.

Parameters

string|array $key
mixed $value

Return Value

HasContextTrait $this

static string getLayoutContent()

Get the top-most layout content from the stack.

Return Value

string

string getFilepath()

Get filepath.

Return Value

string

PhpView setFilepath(string $filepath)

Set filepath.

Parameters

string $filepath

Return Value

PhpView $this

ViewInterface|null getLayout()

Get layout.

Return Value

ViewInterface|null

PhpView setLayout(ViewInterface $layout)

Set layout.

Parameters

ViewInterface $layout

Return Value

PhpView $this

string toString()

Render the view to a string.

Return Value

string

ResponseInterface toResponse()

Convert to Psr\Http\Message\ResponseInterface.

Return Value

ResponseInterface