Loads template from the filesystem.
More...
|
| | __construct ($paths=array()) |
| | Constructor. More...
|
| |
| | getPaths ($namespace=self::MAIN_NAMESPACE) |
| | Returns the paths to the templates. More...
|
| |
| | getNamespaces () |
| | Returns the path namespaces. More...
|
| |
| | setPaths ($paths, $namespace=self::MAIN_NAMESPACE) |
| | Sets the paths where templates are stored. More...
|
| |
| | addPath ($path, $namespace=self::MAIN_NAMESPACE) |
| | Adds a path where templates are stored. More...
|
| |
| | prependPath ($path, $namespace=self::MAIN_NAMESPACE) |
| | Prepends a path where templates are stored. More...
|
| |
| | getSource ($name) |
| | {Gets the source code of a template, given its name.- Parameters
-
| string | $name | The name of the template to load |
- Returns
- string The template source code
- Exceptions
-
} More...
|
| |
| | getCacheKey ($name) |
| | {Gets the cache key to use for the cache for a given template name.- Parameters
-
| string | $name | The name of the template to load |
- Returns
- string The cache key
- Exceptions
-
} More...
|
| |
| | exists ($name) |
| | {Check if we have the source code of a template, given its name.- Parameters
-
| string | $name | The name of the template to check if we can load |
- Returns
- boolean If the template source code is handled by this loader or not
} More...
|
| |
| | isFresh ($name, $time) |
| | {Returns true if the template is still fresh.- Parameters
-
| string | $name | The template name |
| timestamp | $time | The last modification time of the cached template |
- Returns
- Boolean true if the template is fresh, false otherwise
- Exceptions
-
} More...
|
| |
Loads template from the filesystem.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Definition at line 17 of file Filesystem.php.
| __construct |
( |
|
$paths = array() | ) |
|
Constructor.
- Parameters
-
| string | array | $paths | A path or an array of paths where to look for templates |
Definition at line 30 of file Filesystem.php.
| addPath |
( |
|
$path, |
|
|
|
$namespace = self::MAIN_NAMESPACE |
|
) |
| |
Adds a path where templates are stored.
- Parameters
-
| string | $path | A path where to look for templates |
| string | $namespace | A path name |
- Exceptions
-
Definition at line 87 of file Filesystem.php.
{Check if we have the source code of a template, given its name.
- Parameters
-
| string | $name | The name of the template to check if we can load |
- Returns
- boolean If the template source code is handled by this loader or not
}
Implements Twig_ExistsLoaderInterface.
Definition at line 144 of file Filesystem.php.
{Gets the cache key to use for the cache for a given template name.
- Parameters
-
| string | $name | The name of the template to load |
- Returns
- string The cache key
- Exceptions
-
}
Implements Twig_LoaderInterface.
Definition at line 136 of file Filesystem.php.
Returns the path namespaces.
The main namespace is always defined.
- Returns
- array The array of defined namespaces
Definition at line 56 of file Filesystem.php.
| getPaths |
( |
|
$namespace = self::MAIN_NAMESPACE | ) |
|
Returns the paths to the templates.
- Parameters
-
| string | $namespace | A path namespace |
- Returns
- array The array of paths where to look for templates
Definition at line 44 of file Filesystem.php.
{Gets the source code of a template, given its name.
- Parameters
-
| string | $name | The name of the template to load |
- Returns
- string The template source code
- Exceptions
-
}
Implements Twig_LoaderInterface.
Definition at line 128 of file Filesystem.php.
{Returns true if the template is still fresh.
- Parameters
-
| string | $name | The template name |
| timestamp | $time | The last modification time of the cached template |
- Returns
- Boolean true if the template is fresh, false otherwise
- Exceptions
-
}
Implements Twig_LoaderInterface.
Definition at line 163 of file Filesystem.php.
| prependPath |
( |
|
$path, |
|
|
|
$namespace = self::MAIN_NAMESPACE |
|
) |
| |
Prepends a path where templates are stored.
- Parameters
-
| string | $path | A path where to look for templates |
| string | $namespace | A path name |
- Exceptions
-
Definition at line 107 of file Filesystem.php.
| setPaths |
( |
|
$paths, |
|
|
|
$namespace = self::MAIN_NAMESPACE |
|
) |
| |
Sets the paths where templates are stored.
- Parameters
-
| string | array | $paths | A path or an array of paths where to look for templates |
| string | $namespace | A path namespace |
Definition at line 67 of file Filesystem.php.
| const MAIN_NAMESPACE = '__main__' |
The documentation for this class was generated from the following file: