|
|
| $paths = [] |
|
| $cache = [] |
|
| $errorCache = [] |
Loads template from the filesystem.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ __construct()
| __construct |
( |
| $paths = [], |
|
|
?string | $rootPath = null ) |
- Paramètres
-
| string | string[] | $paths | A path or an array of paths where to look for templates |
| string | null | $rootPath | The root path common to all relative paths (null for getcwd()) |
◆ addPath()
| addPath |
( |
string | $path, |
|
|
string | $namespace = self::MAIN_NAMESPACE ) |
◆ exists()
◆ findTemplate()
| findTemplate |
( |
string | $name, |
|
|
bool | $throw = true ) |
|
protected |
◆ getCacheKey()
| getCacheKey |
( |
string | $name | ) |
|
Gets the cache key to use for the cache for a given template name.
- Exceptions
-
| LoaderError | When $name is not found |
Implémente LoaderInterface.
◆ getNamespaces()
Returns the path namespaces.
The main namespace is always defined.
- Renvoie
- list<string>
◆ getPaths()
| getPaths |
( |
string | $namespace = self::MAIN_NAMESPACE | ) |
|
Returns the paths to the templates.
- Renvoie
- list<string>
◆ getSourceContext()
| getSourceContext |
( |
string | $name | ) |
|
Returns the source context for a given template logical name.
- Exceptions
-
| LoaderError | When $name is not found |
Implémente LoaderInterface.
◆ isFresh()
| isFresh |
( |
string | $name, |
|
|
int | $time ) |
- Paramètres
-
| int | $time | Timestamp of the last modification time of the cached template |
- Exceptions
-
| LoaderError | When $name is not found |
Implémente LoaderInterface.
◆ prependPath()
| prependPath |
( |
string | $path, |
|
|
string | $namespace = self::MAIN_NAMESPACE ) |
◆ setPaths()
| setPaths |
( |
| $paths, |
|
|
string | $namespace = self::MAIN_NAMESPACE ) |
- Paramètres
-
| string | string[] | $paths | A path or an array of paths where to look for templates |
◆ MAIN_NAMESPACE
| const MAIN_NAMESPACE = '__main__' |
Identifier of the main namespace.
La documentation de cette classe a été générée à partir du fichier suivant :
- vendor/twig/twig/src/Loader/FilesystemLoader.php