进入官网下载4.0
将lib目录拷贝到项目中:
新建2个文件一个
smarty.php:
- <?php
- include_once("smarty/Smarty.class.php");
- $smarty = new Smarty();
- $hello = "Hello World";
- $smarty->assign("hello", $hello);
- $smarty->display("smarty.html");
- ?>
smart.html:
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- </head>
- <body>
- {$hello}
- </body>
- </html>