首先你应该引入smarty然后在类的构造函数里面这样写$smarty = new smarty();$this->smarty->smarty属性设置;$this->smarty->smarty属性设置;$this->smarty->smarty属性设置; 然后你在类的其他方法里面就可以这样调用smary了 $this->smarty->assign();$this->smarty->display();