For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > March 2006 > Re: [SMARTY] Template last modification date









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Template last modification date
Evan Wagner

2006-03-17, 6:59 pm

Change the $filename variable to the path and filename of your template
file:

---- BEGIN PHP CODE --------
$filename = "templates/index.tpl";
$smarty->assign('filemodified', date ("F d Y H:i:s.",
filemtime($filename)));
------ END PHP CODE ---------

----- BEGIN TEMPLATE CODE -----
File last modified on {$filemodified}
----- END TEMPLATE CODE ------

On 3/17/06, Robert Hicks <sigzero@gmail.com> wrote:
>
> I thought I had seen this somewhere on the site but I have been looking
> all morning.
>
> Is there a simple way to display the last mod date of a template?
>
> Robert
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Robert Hicks

2006-03-17, 6:59 pm

Evan Wagner wrote:
> Change the $filename variable to the path and filename of your template
> file:
>
> ---- BEGIN PHP CODE --------
> $filename = "templates/index.tpl";
> $smarty->assign('filemodified', date ("F d Y H:i:s.",
> filemtime($filename)));
> ------ END PHP CODE ---------
>
> ----- BEGIN TEMPLATE CODE -----
> File last modified on {$filemodified}
> ----- END TEMPLATE CODE ------
>
> On 3/17/06, Robert Hicks <sigzero@gmail.com> wrote:


Thank you!

Robert
messju mohr

2006-03-17, 6:59 pm

On Fri, Mar 17, 2006 at 10:51:08AM -0500, Robert Hicks wrote:
> Evan Wagner wrote:

of course this doesn't work transparently with your smarty
configuration and it does not word for resources.
[color=darkred]
>
> Thank you!
>
> Robert
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


messju mohr

2006-03-17, 6:59 pm

On Fri, Mar 17, 2006 at 01:23:41PM -0500, Evan Wagner wrote:
> {flamewar}I think it works fine{/flamewar}


yes it does work fine. but it does answer the wong question. it
answers "how can i display the modification time of a local file?" and
not "how can I display the modification time of a smarty template?".
[color=darkred]
> On 3/17/06, messju mohr <messju@lammfellpuschen.de> wrote:

Robert Hicks

2006-03-20, 7:57 am

messju mohr wrote:
> On Fri, Mar 17, 2006 at 01:23:41PM -0500, Evan Wagner wrote:
>
> yes it does work fine. but it does answer the wong question. it
> answers "how can i display the modification time of a local file?" and
> not "how can I display the modification time of a smarty template?".
>

For "my" purposes, they are one and the same. : )

Robert
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com