<?php
/**
 * @package HaloMVC
 */
namespace HaloMVC;
 
/**
 * @author main view Class
 */
class View
{
    /**
     * The Route path consisting of route elements
     * @var string
     */
    private $_view = 'home';



    /**
     * Class Constructor
     * @param string $path optional
     */
    public function __construct( $view = NULL )
    {
        if( NULL !== $view )
            $this->setView( $view );
    }

    /**
     * Set the route path
     * @param string $path
     * @return Route
     */
    public function setView( $view )
    {
        $this->_view = $view;

        return $this;
    }

    /**
     * Get the route path
     * @return string
     * @access public
     */
    public function getView()
    {
        return $this->_view;
    }
   
   
    /**
     * Get the route path
     * @return string
     * @access public
     */
    public function renderView($parameters)
    {
        $loader = new \Twig_Loader_Filesystem(Config::option('views_dir'));
        $twig = new \Twig_Environment($loader);
        $parameters['app_paths'] = Config::getConfigPaths();
        $template = $twig->loadTemplate($this->getView() . '.html');
		$template->display($parameters);
    }
     
   
   
}

?>