FileViewFinder
class FileViewFinder implements ViewFinderInterface (View source)
Properties
protected Filesystem | $files | The filesystem instance. | |
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
void | __construct(Filesystem $files, array $paths, array $extensions = null) Create a new file view loader instance. | |
string | find(string $name) Get the fully qualified location of the view. | |
string | findNamespacedView(string $name) Get the path to a template with a named path. | |
array | parseNamespaceSegments(string $name) Get the segments of a template with a named path. | |
string | findInPaths(string $name, array $paths) Find the given view in the list of paths. | |
array | getPossibleViewFiles(string $name) Get an array of possible view files. | |
void | addLocation(string $location) Add a location to the finder. | |
void | prependLocation(string $location) Prepend a location to the finder. | |
string | resolvePath(string $path) Resolve the path. | |
void | addNamespace(string $namespace, string|array $hints) Add a namespace hint to the finder. | |
void | prependNamespace(string $namespace, string|array $hints) Prepend a namespace hint to the finder. | |
void | replaceNamespace(string $namespace, string|array $hints) Replace the namespace hints for the given namespace. | |
void | addExtension(string $extension) Register an extension with the view finder. | |
bool | hasHintInformation(string $name) Returns whether or not the view name has any hint information. | |
void | flush() Flush the cache of located views. | |
Filesystem | getFilesystem() Get the filesystem instance. | |
$this | setPaths(array $paths) Set the active view paths. | |
array | getPaths() Get the active view paths. | |
array | getViews() Get the views that have been located. | |
array | getHints() Get the namespace to file path hints. | |
array | getExtensions() Get registered extensions. |
Details
void __construct(Filesystem $files, array $paths, array $extensions = null)
Create a new file view loader instance.
string find(string $name)
Get the fully qualified location of the view.
protected string findNamespacedView(string $name)
Get the path to a template with a named path.
protected array parseNamespaceSegments(string $name)
Get the segments of a template with a named path.
protected string findInPaths(string $name, array $paths)
Find the given view in the list of paths.
protected array getPossibleViewFiles(string $name)
Get an array of possible view files.
void addLocation(string $location)
Add a location to the finder.
void prependLocation(string $location)
Prepend a location to the finder.
protected string resolvePath(string $path)
Resolve the path.
void addNamespace(string $namespace, string|array $hints)
Add a namespace hint to the finder.
void prependNamespace(string $namespace, string|array $hints)
Prepend a namespace hint to the finder.
void replaceNamespace(string $namespace, string|array $hints)
Replace the namespace hints for the given namespace.
void addExtension(string $extension)
Register an extension with the view finder.
bool hasHintInformation(string $name)
Returns whether or not the view name has any hint information.
void flush()
Flush the cache of located views.
Filesystem getFilesystem()
Get the filesystem instance.
$this setPaths(array $paths)
Set the active view paths.
array getPaths()
Get the active view paths.
array getViews()
Get the views that have been located.
array getHints()
Get the namespace to file path hints.
array getExtensions()
Get registered extensions.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/View/FileViewFinder.html