Newbie question... last modified timestamp

From: Date: Tue, 16 Apr 2002 06:46:01 +0000
Subject: Newbie question... last modified timestamp
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3762@lists.php.net to get a copy of this message
Hello... I'm new to the list, and not a very experienced programmer, so please excuse me if it shows. (And I'm sure it does. ^_^) First of all let me explain how I've organized my site with Smarty templates. It's very simple. I have one template (let's call it layout.tpl) that contains the basic layout for my whole site. This is the template displayed by my index.php file. Within layout.tpl, I've included several sub-templates: header.tpl, navigation.tpl, footer.tpl, and a template with the content of whatever page is being shown. (Its name is determined by whatever variable index.php is queried with.) Okay. What I want to do is display a "last modified" date on the footer for all of my pages. Specifically, it's the date on which the content template currently being shown was modified. So, say I'm looking at index.php?page=blah. I want footer.tpl to display the date that blah.tpl was last modified. I know of a php function (filemtime, I believe) that can get the "last modified" timestamp for a particular file. But this would require that I either embed php code into footer.tpl, or get the timestamp from index.php and pass it to footer.tpl as a variable. Sorry for the long winded explanation, but... what I really want to know is if there's a Smarty function that can get this timestamp for me. But if not, could anyone suggest to me a good way of retrieving the "last modified" timestamp with php code? Thank you very much for reading through this, I hope someone will be able to help me! Sally

« previous php.smarty.general (#3762) next »