For questions about smarty, please! Thank you!

Source: Internet
Author: User
For questions about smarty, please advise !! Thank you !! Thank you for your advice! Thank you !!! The first time I got in touch with smarty, I reported an error when I used it for the first time. the browser showed the following: However, when I refreshed the prompt information, the browser still did not output anything! StrictStandards: strftime () [function. strftime]: Itisnotsafetorely & nbsp; ont. For more information about smarty, see this article !! Thank you !!
Thank you for your advice! Thank you !!!

The first time I got in touch with smarty, I reported an error when I used it for the first time. the browser showed the following: However, when I refreshed the prompt information, the browser still did not output anything!
Strict Standards: strftime () [function. strftime]: It is not 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.
In case you used any of those methods and you are still getting this
Warning, you 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 (); // Create a smarty instance object $ smarty
$ Smarty-> config_dir = "Smarty/Config_File.class.php"; // Directory variable
$ Smarty-> caching = false; // whether to use the cache. during project debugging, it is not recommended to enable the cache.
$ Smarty-> template_dir = "./templates"; // set the template directory
$ Smarty-> compile_dir = "./templates_c"; // Set the compilation Directory
$ Smarty-> cache_dir = "./smarty_cache"; // cache folder
//----------------------------------------------------
// Left and right boundary characters. the default value is {}, but it is easy to conflict with JavaScript in actual application.
//----------------------------------------------------
$ Smarty-> left_delimiter = "<{";
$ Smarty-> right_delimiter = "}> ";
?>

Index. php
Include ("Smarty_inc.php ");
$ Name = "initial smarty ";
$ Smarty-> assign ("title", $ naem );
$ Smarty-> display ("index.html ");
?>

Index.html




<{$ Title}>






------ Solution --------------------
No timezone is set. modify the opened php. ini file
Date. timezone = Asia/Shanghai, and then restart webserver
------ Solution --------------------
This is because the default time zone is not set. add the following at the beginning of the PHP file:
PHP code
Date_default_timezone_set ('prc ');
------ Solution --------------------
Or
PHP code
    ------ Solution --------------------
This is not a smarty error, but your php environment is not properly configured.
Set the time zone for date. timezone in php. ini
Or set the time zone using the date_default_timezone_set function in the program.

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.