Home >Backend Development >PHP Tutorial >s.m.art exhibition Smarty installation and configuration method
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 in the website root directory Create two directories, templates and templates_c
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"; //Compile directory
$smarty -> left_delimiter = "{{"; //Left delimiter Symbol
$smarty -> right_delimiter = "}}"; //Right delimiter
$smarty -> assign('test','OK');
$smarty -> display('test.html' ;