ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_LoaderInterface Interface Reference

Interface all loaders must implement. More...

+ Inheritance diagram for Twig_LoaderInterface:
+ Collaboration diagram for Twig_LoaderInterface:

Public Member Functions

 getSource ($name)
 Gets the source code of a template, given its name. More...
 
 getCacheKey ($name)
 Gets the cache key to use for the cache for a given template name. More...
 
 isFresh ($name, $time)
 Returns true if the template is still fresh. More...
 

Detailed Description

Interface all loaders must implement.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 17 of file LoaderInterface.php.

Member Function Documentation

◆ getCacheKey()

Twig_LoaderInterface::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

Implemented in Twig_Loader_Filesystem, Twig_Loader_Chain, Twig_Loader_Array, and Twig_Loader_String.

◆ getSource()

Twig_LoaderInterface::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
Deprecated:
since 1.27 (to be removed in 2.0), implement Twig_SourceContextLoaderInterface

Implemented in Twig_Loader_Filesystem, Twig_Loader_Array, Twig_Loader_Chain, and Twig_Loader_String.

◆ isFresh()

Twig_LoaderInterface::isFresh (   $name,
  $time 
)

Returns true if the template is still fresh.

Parameters
string$nameThe template name
int$timeTimestamp of the last modification time of the cached template
Returns
bool true if the template is fresh, false otherwise
Exceptions
Twig_Error_LoaderWhen $name is not found

Implemented in Twig_Loader_Filesystem, Twig_Loader_Chain, Twig_Loader_Array, and Twig_Loader_String.


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