Template caching
| From: | Ryan Sarver | Date: | Wed, 19 Mar 2003 18:56:36 +0000 |
| Subject: | Template caching | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8746@lists.php.net to get a copy of this message | ||
I am trying to write a script that selects a different template dir based on
the browser agent. So for all of hte basic browsers it serves a basic site,
but for wap/pda browsers it serves from a different dir. But even when it
cant find the directory, it is showing some kind of cached version. I dont
even have a Template_c dir. This is my basic code, i am using Netscape to
mimic a PDA...
if(strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))
{
$smarty->template_dir = "./templates";
echo "MSIE: ".$smarty->template_dir."<BR>";
}
elseif (strstr($_SERVER["HTTP_USER_AGENT"], "Netscape"))
{
$smarty->template_dir = "./templates/lite";
echo "Netscape: ".$smarty->template_dir."<BR>";
}
else
{
$smarty->template_dir = "./templates";
echo "Other<BR>";
}
Any ideas?
Ryan Sarver