[pLog-svn] Smarty caching problem

Christoph Feddersen feddersen at herr-der-ringe-film.de
Sun Jan 29 10:08:24 GMT 2006



Jon Daley wrote:
>> On Sat, 28 Jan 2006, Christoph Feddersen wrote:
>>> Just curious, because the {dynamic} blogs and non cacheable plugins
>>> obviously don't work with PHP 5.1.x.
> 
>     What does this mean?  The documentation doesn't say anything about
> it, does it?

According to their changelog, they're currently working on PHP 5.1
support: http://smarty.php.net/misc/NEWS

 - fix improper use of references in the compiler handling cached
   attributes and in compiled code handling block plugins (messju)


> Can you put {dynamic} in your template code and put
> something that prints out the date inside, and see if it changes?

I'm not sure if my test case can be used for plugins also, but here's my
 code.

smarty_test.php
===============

<?php
require('class/template/smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->caching = true;


function smarty_block_dynamic($param, $content, &$smarty) {
    return $content;
}
$smarty->register_block('dynamic', 'smarty_block_dynamic', false);
$smarty->display('index.tpl');
?>

index.tpl
=========

Page created: {"0"|date_format:"%D %H:%M:%S"}
<br />
{dynamic}

Now is: {"0"|date_format:"%D %H:%M:%S"}

... do other stuff ...

{/dynamic}
<br />
Now including template a:
{include file="a.tpl" }

a.tpl
=====

I'm template "a.tpl" <br />

Page created: {"0"|date_format:"%D %H:%M:%S"}
 <br />
{dynamic}

Now is: {"0"|date_format:"%D %H:%M:%S"} <br />

... do other stuff ...

{/dynamic}


More information about the pLog-svn mailing list