|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
On Fri, Mar 17, 2006 at 10:01:01AM -0500, Robert Hicks 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? No, AFAIK there is not *simple* way. A not so simple way would be using smarty's internal Smarty::_fetch_resource_info() function. But this one is internal and not dokumented. You may have to figure it out yourself and there is no warrenty that it's API may not change some day (though it is very unlikely that it may change in Smarty-2.x) > Robert > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEGtHoubKPpFA4n0URAmWFAJ4qo8lvBXN1I9YupDQ+x+ Gn/IMy3wCfUvXt 87V/1D5ssTPs9W6p6HRUiXY= =5EXa -----END PGP SIGNATURE----- |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
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 > > |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
On Fri, Mar 17, 2006 at 10:51:08AM -0500, Robert Hicks wrote:
> 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 ------ of course this doesn't work transparently with your smarty configuration and it does not word for resources. > >On 3/17/06, Robert Hicks <sigzero@gmail.com> wrote: > > Thank you! > > Robert > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEGvw6ubKPpFA4n0URAlCIAKCSM+1v3XVlE8upSJjAqV PT9kKpZwCfbMWh KpF8Wjw835GedTTFyGTkmFg= =Maol -----END PGP SIGNATURE----- |
|
|
|
#6 (permalink) |
|
Messages: n/a
Hébergeur: |
{flamewar}I think it works fine{/flamewar}
On 3/17/06, messju mohr <messju@lammfellpuschen.de> wrote: > > On Fri, Mar 17, 2006 at 10:51:08AM -0500, Robert Hicks wrote: > > 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 ------ > > of course this doesn't work transparently with your smarty > configuration and it does not word for resources. > > > >On 3/17/06, Robert Hicks <sigzero@gmail.com> wrote: > > > > Thank you! > > > > Robert > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > |
|
|
|
#7 (permalink) |
|
Messages: n/a
Hébergeur: |
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?". > On 3/17/06, messju mohr <messju@lammfellpuschen.de> wrote: > > > > On Fri, Mar 17, 2006 at 10:51:08AM -0500, Robert Hicks wrote: > > > 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 ------ > > > > of course this doesn't work transparently with your smarty > > configuration and it does not word for resources. > > > > > >On 3/17/06, Robert Hicks <sigzero@gmail.com> wrote: > > > > > > Thank you! > > > > > > Robert > > > > > > -- > > > Smarty General Mailing List (http://smarty.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEGwJfubKPpFA4n0URAqSdAJ9TYRLfK1rrgf86NAPsed UMfUbadwCdGke7 cSq8hCJnZnwwhGbM2RkreqI= =risc -----END PGP SIGNATURE----- |
|
|
|
#8 (permalink) |
|
Messages: n/a
Hébergeur: |
messju mohr wrote:
> 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?". > For "my" purposes, they are one and the same. : ) Robert |
|
![]() |
| Outils de la discussion | |
|
|