PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Twig_Loader_Filesystem Class Reference

Loads template from the filesystem. More...

Inheritance diagram for Twig_Loader_Filesystem:
Twig_LoaderInterface Twig_ExistsLoaderInterface

Public Member Functions

 __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$nameThe name of the template to load
Returns
string The template source code
Exceptions
Twig_Error_LoaderWhen $name is not found
} More...
 
 getCacheKey ($name)
 {Gets the cache key to use for the cache for a given template name.
Parameters
string$nameThe name of the template to load
Returns
string The cache key
Exceptions
Twig_Error_LoaderWhen $name is not found
} More...
 
 exists ($name)
 {Check if we have the source code of a template, given its name.
Parameters
string$nameThe 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$nameThe template name
timestamp$timeThe last modification time of the cached template
Returns
Boolean true if the template is fresh, false otherwise
Exceptions
Twig_Error_LoaderWhen $name is not found
} More...
 

Data Fields

const MAIN_NAMESPACE = '__main__'
 Identifier of the main namespace. More...
 

Protected Member Functions

 findTemplate ($name)
 
 validateName ($name)
 

Protected Attributes

 $paths
 
 $cache
 

Detailed Description

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.

Constructor & Destructor Documentation

__construct (   $paths = array())

Constructor.

Parameters
string | array$pathsA path or an array of paths where to look for templates

Definition at line 30 of file Filesystem.php.

Member Function Documentation

addPath (   $path,
  $namespace = self::MAIN_NAMESPACE 
)

Adds a path where templates are stored.

Parameters
string$pathA path where to look for templates
string$namespaceA path name
Exceptions
Twig_Error_Loader

Definition at line 87 of file Filesystem.php.

exists (   $name)

{Check if we have the source code of a template, given its name.

Parameters
string$nameThe 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.

findTemplate (   $name)
protected

Definition at line 168 of file Filesystem.php.

getCacheKey (   $name)

{Gets the cache key to use for the cache for a given template name.

Parameters
string$nameThe name of the template to load
Returns
string The cache key
Exceptions
Twig_Error_LoaderWhen $name is not found
}

Implements Twig_LoaderInterface.

Definition at line 136 of file Filesystem.php.

getNamespaces ( )

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$namespaceA path namespace
Returns
array The array of paths where to look for templates

Definition at line 44 of file Filesystem.php.

getSource (   $name)

{Gets the source code of a template, given its name.

Parameters
string$nameThe name of the template to load
Returns
string The template source code
Exceptions
Twig_Error_LoaderWhen $name is not found
}

Implements Twig_LoaderInterface.

Definition at line 128 of file Filesystem.php.

isFresh (   $name,
  $time 
)

{Returns true if the template is still fresh.

Parameters
string$nameThe template name
timestamp$timeThe last modification time of the cached template
Returns
Boolean true if the template is fresh, false otherwise
Exceptions
Twig_Error_LoaderWhen $name is not found
}

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$pathA path where to look for templates
string$namespaceA path name
Exceptions
Twig_Error_Loader

Definition at line 107 of file Filesystem.php.

setPaths (   $paths,
  $namespace = self::MAIN_NAMESPACE 
)

Sets the paths where templates are stored.

Parameters
string | array$pathsA path or an array of paths where to look for templates
string$namespaceA path namespace

Definition at line 67 of file Filesystem.php.

validateName (   $name)
protected

Definition at line 205 of file Filesystem.php.

Field Documentation

$cache
protected

Definition at line 23 of file Filesystem.php.

$paths
protected

Definition at line 22 of file Filesystem.php.

const MAIN_NAMESPACE = '__main__'

Identifier of the main namespace.

Definition at line 20 of file Filesystem.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:44 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.