473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.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

Dec 20 '05 #1
0 1584

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Brian | last post by:
I have an application that uses an array of values as a "lookup" table and smarty as a template engine. $lookup = "label"; $lookup = "label2"; $lookup = "label"; $lookup = "label2"; In my...
1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
1
by: Wensheng | last post by:
Hi, I wrote a small template engine called spytee. Like any template enigne, it take a text(html) template file as input, process the variable tags in the file, and display the resulted text. The...
2
by: steve.high | last post by:
I hope someone here with experience could add their two cents, as I am kind of a noob to the ZF and Smarty. >From my observation, the View API in the ZF does pretty much everything that Smarty...
10
by: global | last post by:
There is a Template Engine for C like Smarty (http://smarty.php.net/) to separate the html from the C code? Thanks, Carlos.
6
by: alvarojaviervera | last post by:
Im programer (about 2 years ago I started), and allways I use PEAR. and Now I was thinking about change my tool for building custom dynamic sites. What do you think sholud be better Smarty, may be...
2
by: Gene | last post by:
i'm newcomer in using smarty and i have problem like this: i want to have one template file (e.g. index.tpl) in this file section which use variable {$content}. and two files *.php which are using...
0
by: lkrzysiak | last post by:
Hi, I want to replace default Symfony caching system with memcache deamon (via sfMemcachePlugin). I would like to use smarty templating engine instead the default symfony template system (via...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.