Factory
class Factory implements Factory (View source)
Methods
Create a new view factory instance.
Get the evaluated view contents for the given view.
Get the evaluated view contents for the given view.
Register a named view.
Add an alias for a view.
Determine if a given view exists.
Get the rendered contents of a partial from a loop.
Get the appropriate view engine for the given path.
Add a piece of shared data to the environment.
Register multiple view composers via an array.
Start injecting content into a section.
Inject inline content into a section.
Stop injecting content into a section and return its contents.
Stop injecting content into a section.
Stop injecting content into a section and append it.
Get the string contents of a section.
Start injecting content into a push section.
Stop injecting content into a push section.
Get the string contents of a push section.
Flush all of the section contents.
Flush all of the section contents if done rendering.
Increment the rendering counter.
Decrement the rendering counter.
Check if there are no active render operations.
Add a location to the array of view locations.
Add a new namespace to the loader.
Prepend a new namespace to the loader.
Register a valid view extension and its engine.
Get the extension to engine bindings.
Get the engine resolver instance.
Get the view finder instance.
Get the event dispatcher instance.
Get the IoC container instance.
Get an item from the shared data.
Get all of the shared data for the environment.
Check if section exists.
Get the entire array of sections.
Get all of the registered named views in environment.
Details
at line line 123
void
__construct(
EngineResolver $engines,
ViewFinderInterface $finder,
Dispatcher $events)
Create a new view factory instance.
at line line 140
View
file(
string $path,
array $data = array(),
array $mergeData = array())
Get the evaluated view contents for the given view.
at line line 157
View
make(
string $view,
array $data = array(),
array $mergeData = array())
Get the evaluated view contents for the given view.
at line line 211
View
of(
string $view,
mixed $data = array())
Get the evaluated view contents for a named view.
at line line 266
string
renderEach(
string $view,
array $data,
string $iterator,
string $empty = 'raw|')
Get the rendered contents of a partial from a loop.
at line line 303
EngineInterface
getEngineFromPath(
string $path)
Get the appropriate view engine for the given path.
at line line 336
mixed
share(
array|string $key,
mixed $value = null)
Add a piece of shared data to the environment.
at line line 354
array
creator(
array|string $views,
Closure|string $callback)
Register a view creator event.
at line line 390
array
composer(
array|string $views,
Closure|string $callback,
int|null $priority = null)
Register a view composer event.
at line line 531
void
startSection(
string $section,
string $content = '')
Start injecting content into a section.
at line line 549
void
inject(
string $section,
string $content)
Inject inline content into a section.
at line line 559
string
yieldSection()
Stop injecting content into a section and return its contents.
at line line 575
string
stopSection(
bool $overwrite = false)
Stop injecting content into a section.
at line line 638
string
yieldContent(
string $section,
string $default = '')
Get the string contents of a section.
at line line 660
void
startPush(
string $section,
string $content = '')
Start injecting content into a push section.
at line line 716
string
yieldPushContent(
string $section,
string $default = '')
Get the string contents of a push section.
at line line 746
void
flushSectionsIfDoneRendering()
Flush all of the section contents if done rendering.
at line line 801
void
addNamespace(
string $namespace,
string|array $hints)
Add a new namespace to the loader.
at line line 813
void
prependNamespace(
string $namespace,
string|array $hints)
Prepend a new namespace to the loader.
at line line 826
void
addExtension(
string $extension,
string $engine,
Closure $resolver = null)
Register a valid view extension and its engine.
at line line 929
mixed
shared(
string $key,
mixed $default = null)
Get an item from the shared data.