<?php
namespace Qii\View;

use Qii\Exceptions\Unsupported;

class Loader
{
	protected $view;
	protected $allow = array('smarty', 'require', 'include');
	
	public function __construct()
	{

	}
	
	public function setView($engine, $policy = array())
	{
		if(!in_array($engine, $this->allow))
		{
			throw new Unsupported(\Qii::i('Unsupported method', $engine));
		}
		$class = '\Qii\View\\'. ucwords($engine);
		return $this->view = new $class();
	}

	public function getView()
	{
		return $this->view;
	}
}