You are here: Simple Smarty Template Engine Question « PHP Programming Language « IT news, forums, messages
Simple Smarty Template Engine Question

Posted by Conrad on 12/20/05 02:46

Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on
the Windows XP Professional platform and I have the following question:


When I change the 7th line of the script to use a new name and refresh
the browser, it maintains the old value instead of updating to the new
value. Both index.php and SmartySetup.class.php appear below:

index.php:

<?php

require_once('SmartySetup.class.php');

$smarty = new SmartySetup;

$smarty->assign( 'name','Frank');

$smarty->display('index.tpl');

?>

SmartySetup.class.php:

<?php

// load Smarty library
require('Smarty.class.php');

class SmartySetup extends Smarty {

function SmartySetup()
{

// Class Constructor.
// These automatically get set with each new instance.

$this->Smarty();

$this->template_dir = '/wwwroot/test/smarty/templates/';
$this->compile_dir = '/wwwroot/test/smarty/templates_c/';
$this->config_dir = '/wwwroot/test/smarty/configs/';
$this->cache_dir = '/wwwroot/test/smarty/cache/';

$this->caching = true;
$this->assign('app_name', 'Guest Book');
}

}

?>

In short, I would like to make sure that if the page, index.php,
doesn't change then use the cache. However, if the page does change,
then I would like to use the newer copy and update the cache. Thus, if
anyone has any ideas as to how to resolve this issue, please
feel free to post.

Thanks in advance,

-Conrad

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация