Class

CachedStringTemplateLoader

Package: IO\Template\loader Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Benoit SAUTEL ben.popeye@phpboost.com Version: PHPBoost 5.2 - last update: 2014 12 22 Since: PHPBoost 3.0 - 2010 02 06 Located at: io/template/loader/CachedStringTemplateLoader.class.php

This loader is to use when you load a template whose source is directly a PHP string and not a file. It supports caching and saves cache files in the /cache/tpl directory, using a md5 hash to distinguish eache string input.

CachedStringTemplateLoader implements TemplateLoader
Methods summary
public
# __construct( string $content )

Constructs a CachedStringTemplateLoader from the source string.

public string
# load( )

Loads the template.

public boolean
# supports_caching( )

Tells whether the loader supports caching. If it supports it, its CachedStringTemplateLoader::get_cache_file_path() will have to return a non-empty value.

public string
# get_cache_file_path( )

Returns the path of the cache file that can be directly executed by the include PHP instruction. This method must be called only if the loader supports caching, the CachedStringTemplateLoader::supports_caching() enabled you to know that.