FileViewFinder
class FileViewFinder implements ViewFinderInterface
Properties
| protected array | $paths | The array of active view paths. |
|
| protected array | $views | The array of views that have been located. |
|
| protected array | $hints | The namespace to file path hints. |
|
| protected string[] | $extensions | Register a view extension with the finder. |
Methods
Create a new file view loader instance.
Get the fully-qualified location of the view.
Get the path to a template with a named path.
Get the segments of a template with a named path.
Find the given view in the list of paths.
Get an array of possible view files.
Add a location to the finder.
Prepend a location to the finder.
Resolve the path.
Add a namespace hint to the finder.
Prepend a namespace hint to the finder.
Replace the namespace hints for the given namespace.
Register an extension with the view finder.
Returns whether or not the view name has any hint information.
Flush the cache of located views.
Get the filesystem instance.
Set the active view paths.
Get the active view paths.
Get the views that have been located.
Get the namespace to file path hints.
Get registered extensions.
Details
at line 37
__construct(Filesystem $files, array $paths, array|null $extensions = null)
Create a new file view loader instance.
at line 52
string
find(string $view)
Get the fully-qualified location of the view.
at line 68
protected string
findNamespacedView(string $name)
Get the path to a template with a named path.
at line 80
protected array
parseNamespaceSegments(string $name)
Get the segments of a template with a named path.
at line 100
protected string
findInPaths(string $name, array $paths)
Find the given view in the list of paths.
at line 118
protected array
getPossibleViewFiles(string $name)
Get an array of possible view files.
at line 129
void
addLocation(string $location)
Add a location to the finder.
Boot-only. Request-time use changes shared view paths while concurrent coroutines may still be resolving views.
at line 140
void
prependLocation(string $location)
Prepend a location to the finder.
Boot-only. Request-time use changes shared view paths while concurrent coroutines may still be resolving views.
at line 148
protected string
resolvePath(string $path)
Resolve the path.
at line 159
void
addNamespace(string $namespace, string|array $hints)
Add a namespace hint to the finder.
Boot-only. Request-time use changes shared view hints while concurrent coroutines may still be resolving views.
at line 176
void
prependNamespace(string $namespace, string|array $hints)
Prepend a namespace hint to the finder.
Boot-only. Request-time use changes shared view hints while concurrent coroutines may still be resolving views.
at line 193
void
replaceNamespace(string $namespace, string|array $hints)
Replace the namespace hints for the given namespace.
Boot-only. Request-time use changes shared view hints while concurrent coroutines may still be resolving views.
at line 204
void
addExtension(string $extension)
Register an extension with the view finder.
Boot-only. Request-time use changes shared view extensions while concurrent coroutines may still be resolving views.
at line 216
bool
hasHintInformation(string $name)
Returns whether or not the view name has any hint information.
at line 227
void
flush()
Flush the cache of located views.
Boot or tests only. Request-time use clears shared lookup state while concurrent coroutines may still be resolving views.
at line 235
Filesystem
getFilesystem()
Get the filesystem instance.
at line 246
FileViewFinder
setPaths(array $paths)
Set the active view paths.
Boot-only. Request-time use changes shared view paths while concurrent coroutines may still be resolving views.
at line 256
array
getPaths()
Get the active view paths.
at line 264
array
getViews()
Get the views that have been located.
at line 272
array
getHints()
Get the namespace to file path hints.
at line 280
array
getExtensions()
Get registered extensions.