View
class View implements ArrayAccess, View
Properties
protected Factory | $factory | The view factory instance. |
|
protected EngineInterface | $engine | The engine implementation. |
|
protected string | $view | The name of the view. |
|
protected array | $data | The array of view data. |
|
protected string | $path | The path to the view file. |
Methods
Create a new view instance.
Get the string contents of the view.
Get the contents of the view instance.
Get the evaluated contents of the view.
Get the data bound to the view instance.
Get the sections of the rendered view.
Add a piece of data to the view.
Add a view instance to the view data.
Get the name of the view.
Get the name of the view.
Get the array of view data.
Get the path to the view file.
Set the path to the view.
Get the view factory instance.
Get the view's rendering engine.
Determine if a piece of data is bound.
Get a piece of bound data to the view.
Set a piece of data on the view.
Unset a piece of data from the view.
Get a piece of data from the view.
Set a piece of data on the view.
Check if a piece of data is bound to the view.
Remove a piece of bound data from the view.
Get the string contents of the view.
Details
at line 64
void
__construct(Factory $factory, EngineInterface $engine, string $view, string $path, mixed $data = [])
Create a new view instance.
at line 82
string
render(callable $callback = null)
Get the string contents of the view.
at line 111
protected string
renderContents()
Get the contents of the view instance.
at line 135
protected string
getContents()
Get the evaluated contents of the view.
at line 145
protected array
gatherData()
Get the data bound to the view instance.
at line 163
array
renderSections()
Get the sections of the rendered view.
at line 177
$this
with(string|array $key, mixed $value = null)
Add a piece of data to the view.
at line 196
$this
nest(string $key, string $view, array $data = [])
Add a view instance to the view data.
at line 207
$this
withErrors(MessageProvider|array $provider)
Add validation errors to the view.
at line 220
protected MessageBag
formatErrors(MessageProvider|array $provider)
Format the given message provider into a MessageBag.
at line 231
string
name()
Get the name of the view.
at line 241
string
getName()
Get the name of the view.
at line 251
array
getData()
Get the array of view data.
at line 261
string
getPath()
Get the path to the view file.
at line 272
void
setPath(string $path)
Set the path to the view.
at line 282
Factory
getFactory()
Get the view factory instance.
at line 292
EngineInterface
getEngine()
Get the view's rendering engine.
at line 303
bool
offsetExists(string $key)
Determine if a piece of data is bound.
at line 314
mixed
offsetGet(string $key)
Get a piece of bound data to the view.
at line 326
void
offsetSet(string $key, mixed $value)
Set a piece of data on the view.
at line 337
void
offsetUnset(string $key)
Unset a piece of data from the view.
at line 348
mixed
__get(string $key)
Get a piece of data from the view.
at line 360
void
__set(string $key, mixed $value)
Set a piece of data on the view.
at line 371
bool
__isset(string $key)
Check if a piece of data is bound to the view.
at line 382
bool
__unset(string $key)
Remove a piece of bound data from the view.
at line 396
View
__call(string $method, array $parameters)
Dynamically bind parameters to the view.
at line 410
string
__toString()
Get the string contents of the view.