MIOLO26
|
Membros públicos | |
__construct ($path, $cache_id=null, $expire=900) | |
is_cached () | |
fetch_cache ($file) | |
Membros públicos herdados de MBTemplate | |
__construct ($path=null) | |
Path to the templates. | |
set_path ($path) | |
set ($name, $value) | |
fetch ($file) | |
execute ($file) | |
Campos de Dados | |
$cache_id | |
$expire | |
$cached | |
Campos de Dados herdados de MBTemplate | |
$vars | |
$path | |
Holds all the template variables. | |
An extension to Template that provides automatic caching of template contents.
__construct | ( | $path, | |
$cache_id = null, | |||
$expire = 900 ) |
Constructor.
string | $path | path to template files |
string | $cache_id | unique cache identifier |
int | $expire | number of seconds the cache will live |
fetch_cache | ( | $file | ) |
This function returns a cached copy of a template (if it exists), otherwise, it parses it as normal and caches the content.
$file | string the template file |
is_cached | ( | ) |
Test to see whether the currently loaded cache_id has a valid corrosponding cache file.
Cache the results of this is_cached() call. Why? So we don't have to double the overhead for each template. If we didn't cache, it would be hitting the file system twice as much (file_exists() & filemtime() [twice each]).
$cache_id |
$cached |
$expire |