时间:2021-07-01 10:21:17 帮助过:14人阅读
html标签写法{$对象名->属性名/方法名()} 一般还是比较少用的
temp3 {$man->name}
{$man->say()}
name;
}
}
$man= new man();
require('../../smarty3/libs/Smarty.class.php');
require('./mysmarty.class.php');
$smarty=new MySmarty();
// 赋值对象
$smarty->assign('man',$man);
$smarty->display('temp4.html');
?>
template_dir='./temp';
$this->compile_dir='./comp';
因为是父类私有属性,所以不能改写
smarty内部有开放的接口,setTemplateDir可修改*/
public function __construct(){
parent::__construct();
$this->setTemplateDir('./temp');
$this->setCompileDir('./comp');
}
}
以上就介绍了Smarty赋值对象方法,配置简化封装类,包括了require方面的内容,希望对PHP教程有兴趣的朋友有所帮助。