About Smarty problem, seek expert guidance!! Thank you!!
Please expert guidance! Appreciate it!!!
First contact with Smarty, the first time to use the times wrong; The browser is displayed as follows: However, refreshing the message will be no, the browser or nothing output!
Strict standards:strftime () [Function.strftime]: It isn't safe to rely
On the system ' s timezone settings. Please use the Date.timezone setting,
The TZ environment variable or the Date_default_timezone_set () function.
Used any of those methods and you is still getting this
Warning, you are most likely misspelled the timezone identifier. We selected
' UTC ' for ' 8.0/no DST ' instead in
C:\AppServ\www\smarty\Smarty\Smarty_Compiler.class.php on line 400
The configuration is as follows:
smarty_inc.php
Include_once ("smarty/smarty.class.php"); Contains the Smarty class file
$smarty = new Smarty (); Establish the Smarty instance object $smarty
$smarty->config_dir= "smarty/config_file.class.php"; Directory variables
$smarty->caching=false; Whether to use caching, the project is not recommended to enable caching during debugging
$smarty->template_dir = "./templates"; Set up a template directory
$smarty->compile_dir = "./templates_c"; Set compilation directory
$smarty->cache_dir = "./smarty_cache"; Cache folder
//----------------------------------------------------
Left and right boundary characters, default to {}, but the actual application is easy to conflict with JavaScript
//----------------------------------------------------
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
?>
index.php
Include ("smarty_inc.php");
$name = "the first smarty";
$smarty->assign ("title", $naem);
$smarty->display ("index.html");
?>
Index.html
<title></title> <title></title>
<{$title}>
------Solution--------------------
No settings timezone, open the php.ini file modification
Date.timezone=asia/shanghai, and then restart webserver
------Solution--------------------
That is because the default time zone is not set, at the beginning of the PHP file add:
PHP Code
Date_default_timezone_set (' PRC ');
------Solution--------------------
Or so
PHP Code
------Solution--------------------
This is not Smarty's fault, but your PHP environment is not set.
PHP.ini Date.timezone Setting the time zone