Documentation

View
in package
implements ArrayAccess, View

Interfaces, Classes and Traits

ArrayAccess
View

Table of Contents

$data  : array<string|int, mixed>
The array of view data.
$engine  : Engine
The engine implementation.
$factory  : Factory
The view factory instance.
$path  : string
The path to the view file.
$view  : string
The name of the view.
__call()  : View
Dynamically bind parameters to the view.
__construct()  : void
Create a new view instance.
__get()  : mixed
Get a piece of data from the view.
__isset()  : bool
Check if a piece of data is bound to the view.
__set()  : void
Set a piece of data on the view.
__toString()  : string
Get the string contents of the view.
__unset()  : bool
Remove a piece of bound data from the view.
getData()  : array<string|int, mixed>
Get the array of view data.
getEngine()  : Engine
Get the view's rendering engine.
getFactory()  : Factory
Get the view factory instance.
getName()  : string
Get the name of the view.
getPath()  : string
Get the path to the view file.
name()  : string
Get the name of the view.
nest()  : $this
Add a view instance to the view data.
offsetExists()  : bool
Determine if a piece of data is bound.
offsetGet()  : mixed
Get a piece of bound data to the view.
offsetSet()  : void
Set a piece of data on the view.
offsetUnset()  : void
Unset a piece of data from the view.
render()  : string
Get the string contents of the view.
renderSections()  : string
Get the sections of the rendered view.
setPath()  : void
Set the path to the view.
with()  : $this
Add a piece of data to the view.
withErrors()  : $this
Add validation errors to the view.
formatErrors()  : MessageBag
Format the given message provider into a MessageBag.
gatherData()  : array<string|int, mixed>
Get the data bound to the view instance.
getContents()  : string
Get the evaluated contents of the view.
renderContents()  : string
Get the contents of the view instance.

Properties

$data

The array of view data.

protected array<string|int, mixed> $data

$engine

The engine implementation.

protected Engine $engine

$factory

The view factory instance.

protected Factory $factory

$path

The path to the view file.

protected string $path

$view

The name of the view.

protected string $view

Methods

__call()

Dynamically bind parameters to the view.

public __call(string $method, array<string|int, mixed> $parameters) : View
Parameters
$method : string
$parameters : array<string|int, mixed>
Tags
throws
BadMethodCallException
Return values
View

__construct()

Create a new view instance.

public __construct(Factory $factory, Engine $engine, string $view, string $path[, mixed $data = [] ]) : void
Parameters
$factory : Factory
$engine : Engine
$view : string
$path : string
$data : mixed = []
Return values
void

__get()

Get a piece of data from the view.

public __get(string $key) : mixed
Parameters
$key : string
Return values
mixed

__isset()

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

public __isset(string $key) : bool
Parameters
$key : string
Return values
bool

__set()

Set a piece of data on the view.

public __set(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Return values
void

__toString()

Get the string contents of the view.

public __toString() : string
Return values
string

__unset()

Remove a piece of bound data from the view.

public __unset(string $key) : bool
Parameters
$key : string
Return values
bool

getData()

Get the array of view data.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEngine()

Get the view's rendering engine.

public getEngine() : Engine
Return values
Engine

getFactory()

Get the view factory instance.

public getFactory() : Factory
Return values
Factory

getName()

Get the name of the view.

public getName() : string
Return values
string

getPath()

Get the path to the view file.

public getPath() : string
Return values
string

name()

Get the name of the view.

public name() : string
Return values
string

nest()

Add a view instance to the view data.

public nest(string $key, string $view[, array<string|int, mixed> $data = [] ]) : $this
Parameters
$key : string
$view : string
$data : array<string|int, mixed> = []
Return values
$this

offsetExists()

Determine if a piece of data is bound.

public offsetExists(string $key) : bool
Parameters
$key : string
Return values
bool

offsetGet()

Get a piece of bound data to the view.

public offsetGet(string $key) : mixed
Parameters
$key : string
Return values
mixed

offsetSet()

Set a piece of data on the view.

public offsetSet(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Return values
void

offsetUnset()

Unset a piece of data from the view.

public offsetUnset(string $key) : void
Parameters
$key : string
Return values
void

render()

Get the string contents of the view.

public render([callable|null $callback = null ]) : string
Parameters
$callback : callable|null = null
Tags
throws
Throwable
Return values
string

renderSections()

Get the sections of the rendered view.

public renderSections() : string
Return values
string

setPath()

Set the path to the view.

public setPath(string $path) : void
Parameters
$path : string
Return values
void

with()

Add a piece of data to the view.

public with(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
Parameters
$key : string|array<string|int, mixed>
$value : mixed = null
Return values
$this

withErrors()

Add validation errors to the view.

public withErrors(MessageProvider|array<string|int, mixed> $provider) : $this
Parameters
$provider : MessageProvider|array<string|int, mixed>
Return values
$this

gatherData()

Get the data bound to the view instance.

protected gatherData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getContents()

Get the evaluated contents of the view.

protected getContents() : string
Return values
string

renderContents()

Get the contents of the view instance.

protected renderContents() : string
Return values
string

Search results