class View implements ArrayAccess, View (View source)

Methods

void
__construct( Factory $factory, EngineInterface $engine, string $view, string $path, mixed $data = array())

Create a new view instance.

string
render( callable $callback = null)

Get the string contents of the view.

array
renderSections()

Get the sections of the rendered view.

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

Add a piece of data to the view.

$this
nest( string $key, string $view, array $data = array())

Add a view instance to the view data.

$this
withErrors( MessageProvider|array $provider)

Add validation errors to the view.

getFactory()

Get the view factory instance.

getEngine()

Get the view's rendering engine.

string
name()

Get the name of the view.

string
getName()

Get the name of the view.

array
getData()

Get the array of view data.

string
getPath()

Get the path to the view file.

void
setPath( string $path)

Set the path to the view.

bool
offsetExists( string $key)

Determine if a piece of data is bound.

mixed
offsetGet( string $key)

Get a piece of bound data to the view.

void
offsetSet( string $key, mixed $value)

Set a piece of data on the view.

void
offsetUnset( string $key)

Unset a piece of data from the view.

mixed
__get( string $key)

Get a piece of data from the view.

void
__set( string $key, mixed $value)

Set a piece of data on the view.

bool
__isset( string $key)

Check if a piece of data is bound to the view.

bool
__unset( string $key)

Remove a piece of bound data from the view.

__call( string $method, array $parameters)

Dynamically bind parameters to the view.

string
__toString()

Get the string contents of the view.

Details

at line line 64
void __construct( Factory $factory, EngineInterface $engine, string $view, string $path, mixed $data = array())

Create a new view instance.

Parameters

Factory $factory
EngineInterface $engine
string $view
string $path
mixed $data

Return Value

void

at line line 82
string render( callable $callback = null)

Get the string contents of the view.

Parameters

callable $callback

Return Value

string

Exceptions

Throwable

at line line 135
array renderSections()

Get the sections of the rendered view.

Return Value

array

at line line 177
$this with( string|array $key, mixed $value = null)

Add a piece of data to the view.

Parameters

string|array $key
mixed $value

Return Value

$this

at line line 196
$this nest( string $key, string $view, array $data = array())

Add a view instance to the view data.

Parameters

string $key
string $view
array $data

Return Value

$this

at line line 207
$this withErrors( MessageProvider|array $provider)

Add validation errors to the view.

Parameters

MessageProvider|array $provider

Return Value

$this

at line line 223
Factory getFactory()

Get the view factory instance.

Return Value

Factory

at line line 233
EngineInterface getEngine()

Get the view's rendering engine.

Return Value

EngineInterface

at line line 243
string name()

Get the name of the view.

Return Value

string

at line line 253
string getName()

Get the name of the view.

Return Value

string

at line line 263
array getData()

Get the array of view data.

Return Value

array

at line line 273
string getPath()

Get the path to the view file.

Return Value

string

at line line 284
void setPath( string $path)

Set the path to the view.

Parameters

string $path

Return Value

void

at line line 295
bool offsetExists( string $key)

Determine if a piece of data is bound.

Parameters

string $key

Return Value

bool

at line line 306
mixed offsetGet( string $key)

Get a piece of bound data to the view.

Parameters

string $key

Return Value

mixed

at line line 318
void offsetSet( string $key, mixed $value)

Set a piece of data on the view.

Parameters

string $key
mixed $value

Return Value

void

at line line 329
void offsetUnset( string $key)

Unset a piece of data from the view.

Parameters

string $key

Return Value

void

at line line 340
mixed __get( string $key)

Get a piece of data from the view.

Parameters

string $key

Return Value

mixed

at line line 352
void __set( string $key, mixed $value)

Set a piece of data on the view.

Parameters

string $key
mixed $value

Return Value

void

at line line 363
bool __isset( string $key)

Check if a piece of data is bound to the view.

Parameters

string $key

Return Value

bool

at line line 374
bool __unset( string $key)

Remove a piece of bound data from the view.

Parameters

string $key

Return Value

bool

at line line 388
View __call( string $method, array $parameters)

Dynamically bind parameters to the view.

Parameters

string $method
array $parameters

Return Value

View

Exceptions

BadMethodCallException

at line line 402
string __toString()

Get the string contents of the view.

Return Value

string