caching and using insert
| From: | Araki | Date: | Sun, 27 Jul 2003 17:37:05 +0000 |
| Subject: | caching and using insert | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9968@lists.php.net to get a copy of this message | ||
Hello
I have a main template index.tpl
It has something like this
{include file="$show.tpl"} The include depends on the $show.
I want to cache the index.tpl because most of it is static. But i do not
want to cache those other includes.
I tried to use insert. Example:
{insert name="content" show=$show}
function insert_content($array)
{
return '{include file="'.$array['show'].'tpl"}';
}
But smarty do not parse the return off insert_content..
I tried to use this function:
function insert_content($array)
{
return $smarty->display($array['show'].'.tpl');
}
With no caching this works fine :) but when caching is on, the returned info
is printed on the top of the page...
Any ideas?