View
class View implements ArrayAccess, Htmlable, Stringable, View (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected Factory | $factory | The view factory instance. |
|
protected Engine | $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
Mix another object into the class.
Dynamically handle calls to the class.
Create a new view instance.
Get the evaluated contents of a given fragment.
Get the evaluated contents for a given array of fragments or return all fragments.
Get the evaluated contents of a given fragment if the given condition is true.
Get the evaluated contents for a given array of fragments if the given condition is true.
Get all fragments as a single string.
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.
Add validation errors to the view.
Parse the given errors into an appropriate value.
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.
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 content as a string of HTML.
Get the string contents of the view.
Details
__construct(Factory $factory, Engine $engine, string $view, string $path, mixed $data = [])
Create a new view instance.
string
fragments(array|null $fragments = null)
Get the evaluated contents for a given array of fragments or return all fragments.
string
fragmentIf(bool $boolean, string $fragment)
Get the evaluated contents of a given fragment if the given condition is true.
string
fragmentsIf(bool $boolean, array|null $fragments = null)
Get the evaluated contents for a given array of fragments if the given condition is true.
$this
withErrors(MessageProvider|array|string $provider, string $bag = 'default')
Add validation errors to the view.
protected MessageBag
formatErrors(MessageProvider|array|string $provider)
Parse the given errors into an appropriate value.