Welcome to the Linux community forum and interact with 2 million technical staff. Go to php's smarty simple installation configuration Introduction: 1 first, download: 2 and then install: (1) unzip the file, copy the libs file to the root directory of the website and change it to smarty. (2) create four folders in the root directory: templates, templates_c, configs, cache; 3
Welcome to the Linux community forum, interact with 2 million technical staff> go to php's smarty simple installation configuration Introduction: 1 first, download: 2, install: (1) unzip the file, copy the libs file to the root directory of the website and change it to smarty. (2) create four folders in the root directory: templates, templates_c, configs, cache; 3
Welcome to the Linux community forum and interact with 2 million technicians>
Simple installation and configuration of php smarty:
1 first, download:
2. Then, install:
(1) decompress the file, copy the libs file to the root directory of the website, and rename it smarty;
(2) create four folders in the root directory: templates, templates_c, configs, and cache;
3. Finally, test:
(1) create a php file: text. php
Include_once ('smarty/smarty. class. php ');
Include_once ('smarty/config_file.class.php ');
Include_once ('smarty/smarty_compiler.class.php ');
$ Smarty = new Smarty;
$ Smarty-> template_dir = 'templates/'; // template storage directory
$ Smarty-> compile_dir = 'templates _ c/'; // compile the Directory
$ Smarty-> left_delimiter = "{"; // left delimiter
$ Smarty-> right_delimiter = "}"; // right delimiter
$ Smarty-> assign ('name', 'php self-learning net ');
$ Smarty-> assign ('title', 'Welcome to php self-learning Network !);
$ Smarty-> display ('index. tpl ');
?>
(2) create a tpl file under templates: index. tpl
{{$ Title }}</pead>
{$ Name }}
(3) Run test. php and the configuration is successful.