About Smarty related problems, please! Thanks a lot!

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.