Class Twig_Loader_Filesystem

InheritanceTwig_Loader_Filesystem
ImplementsTwig_ExistsLoaderInterface, Twig_LoaderInterface

Loads template from the filesystem.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Twig_Loader_Filesystem
addPath() Adds a path where templates are stored. Twig_Loader_Filesystem
exists() {@inheritdoc} Twig_Loader_Filesystem
getCacheKey() {@inheritdoc} Twig_Loader_Filesystem
getNamespaces() Returns the path namespaces. Twig_Loader_Filesystem
getPaths() Returns the paths to the templates. Twig_Loader_Filesystem
getSource() {@inheritdoc} Twig_Loader_Filesystem
isFresh() {@inheritdoc} Twig_Loader_Filesystem
prependPath() Prepends a path where templates are stored. Twig_Loader_Filesystem
setPaths() Sets the paths where templates are stored. Twig_Loader_Filesystem

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
MAIN_NAMESPACE '__main__' Identifier of the main namespace. Twig_Loader_Filesystem

Property Details

$cache protected property
protected $cache = []
$errorCache protected property
protected $errorCache = []
$paths protected property
protected $paths = []

Method Details

__construct() public method

Constructor.

public void __construct ( $paths = [] )
$paths string|array

A path or an array of paths where to look for templates

addPath() public method

Adds a path where templates are stored.

public void addPath ( $path, $namespace self::MAIN_NAMESPACE )
$path string

A path where to look for templates

$namespace string

A path name

throws Twig_Error_Loader
exists() public method

{@inheritdoc}

public void exists ( $name )
$name
findTemplate() protected method

protected void findTemplate ( $name )
$name
getCacheKey() public method

{@inheritdoc}

public void getCacheKey ( $name )
$name
getNamespaces() public method

Returns the path namespaces.

The main namespace is always defined.

public array getNamespaces ( )
return array

The array of defined namespaces

getPaths() public method

Returns the paths to the templates.

public array getPaths ( $namespace self::MAIN_NAMESPACE )
$namespace string

A path namespace

return array

The array of paths where to look for templates

getSource() public method

{@inheritdoc}

public void getSource ( $name )
$name
isFresh() public method

{@inheritdoc}

public void isFresh ( $name, $time )
$name
$time
normalizeName() protected method

protected void normalizeName ( $name )
$name
parseName() protected method

protected void parseName ( $name, $default self::MAIN_NAMESPACE )
$name
$default
prependPath() public method

Prepends a path where templates are stored.

public void prependPath ( $path, $namespace self::MAIN_NAMESPACE )
$path string

A path where to look for templates

$namespace string

A path name

throws Twig_Error_Loader
setPaths() public method

Sets the paths where templates are stored.

public void setPaths ( $paths, $namespace self::MAIN_NAMESPACE )
$paths string|array

A path or an array of paths where to look for templates

$namespace string

A path namespace

validateName() protected method

protected void validateName ( $name )
$name