[PHPTAL] Cache options from PHP

Kornel Lesinski kornel at aardvarkmedia.co.uk
Mon Apr 7 17:27:42 CEST 2008


On Mon, 07 Apr 2008 15:53:56 +0100, Christoph Frick  
<frick at sc-networks.com> wrote:

> $phptal->set('cache_duration', "3 h");  // variable's value must be  
> integer
> ...
> <div phptal:cache="cache_duration"> <!-- you must put unit in the
> attribute after variable's name -->
>
> i hope this is allowed too?

No, it's not allowed (I don't want to check syntax at run time).

> otherwise, the original requeester still has
> the problem, that template and application logic mix.

The unit is just a syntactic sugar. If application needs finer control  
over cache duration, templates can use seconds as the unit:
<div phptal:cache="cache_duration_seconds s">

-- 
regards, Kornel



More information about the PHPTAL mailing list