Home > Backend Development > PHP Tutorial > Smarty installation and configuration method_PHP tutorial

Smarty installation and configuration method_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:52:44
Original
902 people have browsed it

Download the latest Smarty: http://smarty.php.net/
The latest version: 2.6.18
After unzipping, rename the libs directory in the directory to smarty, copy it to your website directory, and at the same time Create two directories, templates and templates_c, in the root directory of the website
Create test.php with the following content:
include_once('./Smarty/Smarty.class.php');$smarty = new Smarty();
$smarty -> template_dir = "./templates"; //Template storage directory
$smarty -> compile_dir = "./templates_c"; //Compilation directory
$ smarty -> left_delimiter = "{{"; //Left delimiter
$smarty -> right_delimiter = "}}"; //Right delimiter
$smarty -> assign('test ','OK');
$smarty -> display('test.html');
?>
Give templates_c permission 755

Create a new test in the templates directory. html:




{{$test}}


Open test.php. If you see OK, it means your smarty installation is successful!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318884.htmlTechArticleDownload the latest Smarty: http://smarty.php.net/ The latest version: 2.6.18 after unzipping Rename the libs directory in the directory to smarty, copy it to your website directory, and at the same time in the website root directory...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
smarty turns on caching garbled characters
From 1970-01-01 08:00:00
0
0
0
Why does tp use smarty template? ?
From 1970-01-01 08:00:00
0
0
0
How do you use smarty to integrate laravel5?
From 1970-01-01 08:00:00
0
0
0
Two ways to install smarty
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template