Class Twig_Loader_String

ImplementsTwig_ExistsLoaderInterface, Twig_LoaderInterface
Deprecated since version since 1.18.1 (to be removed in 2.0)

Loads a template from a string.

This loader should NEVER be used. It only exists for Twig internal purposes.

When using this loader with a cache mechanism, you should know that a new cache key is generated each time a template content "changes" (the cache key being the source code of the template). If you don't want to see your cache grows out of control, you need to take care of clearing the old cache file by yourself.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
exists() {@inheritdoc} Twig_Loader_String
getCacheKey() {@inheritdoc} Twig_Loader_String
getSource() {@inheritdoc} Twig_Loader_String
isFresh() {@inheritdoc} Twig_Loader_String

Method Details

exists() public method


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


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


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


public void isFresh ( $name, $time )