Download the latest Smarty: http://smarty.php.net/
Latest Version: 2.6.18
Decompress the package and rename the libs directory in the directory to smarty. Copy the libs directory to your website directory, and create the templates and templates_c directories under the website root directory.
Create test. php with the following content:
<? Php
Include_once ('./Smarty. 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 ('test', 'OK ');
$ Smarty-> display('test.html ');
?>
Grant templates_c permissions to 755
Create test.html in the templatesdirectory:
<Html>
<Head>
</Head>
<Body>
{{$ Test }}
</Body>
</Html>
Open test. php. If OK is displayed, your smarty is successfully installed!