From 7808495f593b5c73d876f681909b8077500fe291 Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 9 Aug 2001 19:56:10 +0000 Subject: [PATCH] add smarty.now variable to template --- Smarty.class.php | 2 ++ demo/templates/index.tpl | 2 ++ libs/Smarty.class.php | 2 ++ templates/index.tpl | 2 ++ 4 files changed, 8 insertions(+) diff --git a/Smarty.class.php b/Smarty.class.php index 4f551f90..c07768b5 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -643,6 +643,8 @@ class Smarty } $smarty['request'] = array_merge($smarty['request'], $smarty['session']); + $smarty['now'] = time(); + $this->assign('smarty', $smarty); } diff --git a/demo/templates/index.tpl b/demo/templates/index.tpl index 73c4f8a4..86615df8 100644 --- a/demo/templates/index.tpl +++ b/demo/templates/index.tpl @@ -9,6 +9,8 @@ Title: {#title#|capitalize} {if #bold#}{/if} +The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"} + Tooltip example: Move your mouse over the Help link to see an example of a tooltip using Smarty's popup function. The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME} diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 4f551f90..c07768b5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -643,6 +643,8 @@ class Smarty } $smarty['request'] = array_merge($smarty['request'], $smarty['session']); + $smarty['now'] = time(); + $this->assign('smarty', $smarty); } diff --git a/templates/index.tpl b/templates/index.tpl index 73c4f8a4..86615df8 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -9,6 +9,8 @@ Title: {#title#|capitalize} {if #bold#}{/if} +The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"} + Tooltip example: Move your mouse over the Help link to see an example of a tooltip using Smarty's popup function. The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}