1:https://github.com/smarty-php/smarty/releases/tag/v3.1.33 下载
2:copy文件lib放到自己项目中取
3:代码
PHP代码
<?php
require './libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->assign('variate','你已经学会smarty引擎');
$smarty -> display('./view/index/index.html');
?>
HTML页面
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<p>{$variate}</p>
</body>
</html>