要善于ob_start、ob_get_contents使用,
比如需要ajax获取 请求页面的模板信息
这个时候用到就很便捷
ob_start(); $this->assign('config',$config[$viewkey]); $this->assign('viewkey',$viewkey); $this->assign('pageInfo',$pageInfo); $this->display(); $contents=ob_get_contents(); ob_end_clean(); echo json_encode(array('flag'=>1,'data'=>$contents));