Skip to content

Smarty_Template_Cached

Smarty Resource Data Object Cache Data Container for Template Files

Properties

valid

Cache Is Valid

public bool $valid

handler

CacheResource Handler

public \Smarty_CacheResource $handler

cache_id

Template Cache Id (Smarty_Internal_Template::$cache_id)

public string $cache_id

cache_lifetime

saved cache lifetime in seconds

public int $cache_lifetime

lock_id

Id for cache locking

public string $lock_id

is_locked

flag that cache is locked by this instance

public bool $is_locked

source

Source Object

public \Smarty_Template_Source $source

hashes

Nocache hash codes of processed compiled templates

public array $hashes

isCache

Flag if this is a cache resource

public bool $isCache

Methods

__construct

create Cached Object container

public __construct(\Smarty_Internal_Template $_template): mixed

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template template object

Throws:


load

public static load(\Smarty_Internal_Template $_template): \Smarty_Template_Cached
  • This method is static.

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template

render

Render cache template

public render(\Smarty_Internal_Template $_template, bool $no_output_filter = true): mixed

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template
$no_output_filter bool

Throws:


isCached

Check if cache is valid, lock cache if required

public isCached(\Smarty_Internal_Template $_template): bool

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template

Return Value:

flag true if cache is valid


process

Process cached template

public process(\Smarty_Internal_Template $_template, bool $update = false): mixed

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template template object
$update bool flag if called because cache update

read

Read cache content from handler

public read(\Smarty_Internal_Template $_template): string|false

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template template object

Return Value:

content


Inherited methods

process

Process resource

public process(\Smarty_Internal_Template $_template): mixed
  • This method is abstract.

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template template object

getRenderedTemplateCode

get rendered template content by calling compiled or cached template code

public getRenderedTemplateCode(\Smarty_Internal_Template $_template, string $unifunc = null): mixed

Parameters:

Parameter Type Description
$_template \Smarty_Internal_Template
$unifunc string function with template code

Throws:


getTimeStamp

Get compiled time stamp

public getTimeStamp(): int


Automatically generated on 2025-03-18