时间:2021-07-01 10:21:17 帮助过:8人阅读
//用来定义一个继承Smarty的子类,在构造函数中实现基本的路径配置.....
namespace Smarty;
class Smarty_Test {
function setName(){
echo 'Name';
}
}
use Smarty\Smarty_Test;
$smarty = new Smarty_Test();
$smarty->assign('name','Ned');
$smarty->debugging = true;
$smarty->display('index.tpl');
?>
spl_autoload_register();
use Smarty\Smarty_Test;
$smarty = new Smarty_Test();
$smarty->assign('name','Ned');
$smarty->debugging = true;
$smarty->display('index.tpl');