<?php
class Easy_Controller_View{
	public $viewPath = '';
	public $ViewSuffix = '.htm';
	public $complie;
	public $basedir = '/';
	public $installdir;
	public $error;
	public $message;
	public $printpage;	//分页数据
	public $temporary;	//临时数据存放
	public $skin;
	public $jumpurl;
	public $button;
	public $subject;
	public $meta;
	function __construct(){
		$this->complie = new Easy_View_Default();
	}
	/*设置模板文件根目录位置*/
	function setViewRoot($path){
		$this->viewPath = $path;
	}
	/*获取模板文件路径*/
	function getViewRoot(){
		return $this->viewPath;
	}
	function Render($filename){
		ob_start();
		$this->complie->basedir = $this->basedir;
		$this->complie->skins = $this->basedir.$this->viewPath.'/'.$this->skin;
		$this->printPage = &$this->_Vodcms->printPage;
		include $this->complie->display($this->viewPath.DIRECTORY_SEPARATOR.strtolower($filename).$this->ViewSuffix);
		return ob_get_clean();

	}
	function Redirect($uri = null){
		if (is_null($uri)) $uri = $_SERVER['HTTP_REFERER'];
		header("location:{$this->installdir}$uri");
	}
	public function __set($key, $value){
		$this->$key = $value;
	}
}