note 53203 deleted from function.setlocale by derick
| From: | derick@php.net | Date: | Sat, 10 May 2008 23:44:58 +0000 |
| Subject: | note 53203 deleted from function.setlocale by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139261@lists.php.net to get a copy of this message | ||
Note Submitter: cdblog at gmail dot com
----
When you use Smarty's html_select_date,
you can use setlocale(LC_TIME, string local) in your script before display the template file
then get the local month name,
also, you can copy the "plugins/function.html_select_date.php" to
"plugins/function.html_select_date_local.php",
and modify the function name to smarty_function_html_select_date_local(former is
smarty_function_html_select_date)
for more examples about this function, you can visit my php blog( http://php.clickz.cn/ ) to find more.
this resource's link is http://php.clickz.cn/articles/date/setlocale.html
example test:
<?php
setlocale(LC_TIME,"chs");
$smarty->display("setlocale.tpl");
?>
the setlocale.tpl's content
-------------------------
<html>
<head>My PHP Blog</head>
<body>
{ html_select_date_local prefix="" time=$smarty.get.date month_format="%B"
all_extra="onChange='theFormSubmit();'" end_year=+1 }
</body>
</html>