Simple Smarty Template Engine Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Conrad

    #1

    Simple Smarty Template Engine Question

    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.cla ss.php appear below:

    index.php:

    <?php

    require_once('S martySetup.clas s.php');

    $smarty = new SmartySetup;

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

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

    ?>

    SmartySetup.cla ss.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_na me', '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

Working...