router through the mail in mvc pattern
===

hi i'm new to MVC pattern
i have a big problem and I've stock in it for a days
when i want dispatching a uri through the mail i got error exception
and when i click on my activated link that I've sent before for activate my login i encounter to this error: 

Fatal error: Uncaught exception 'Exception' with message 'Template not found in .... blah blah

this is my link: localhost/ezmvc/index.php?route=activate.php?usr=sadeghii.ehsan@gmail.com&code=5064

and here is my router class

    <?php

	class router
	{
		 private $registry;
		 private $path;
		 private $args = array();
		 public $__file;
		 public $__controller;
		 public $__action;
		 
		 function __construct($registry)
		 {
			$this->registry = $registry;
		 }
		
		# get file name
		 public function getFile()
		 {
		 	$this->getController();
		 	return ($this->__controller) ? $this->__controller : false;
		 }
		
		
		 # load the controller
		 public function dispatch()
		 {
			# set controller path
			$this->path = __SITE_PATH . '/controllers';
		 	
			# check the route
			$this->getController();
		
			if (is_readable($this->__file) == false)
			{
				$this->__file = $this->path.'/error404.php';
				$this->__controller = 'error404';
			}
		
			# include the controller
			require $this->__file;
		
			# a new controller class instance
			$class = $this->__controller . 'Controller';
			$__controller = new $class($this->registry);
		
			# check if the action is callable
			if (is_callable(array($__controller, $this->__action)) == false)
			{
				$__action = 'index';
			}
			else
			{
				$__action = $this->__action;
			}

			#####
			$__action = preg_replace("/[^a-zA-Z0-9_]+/", "", $__action);

			# run the action
			$__controller->$__action();
		 }
		
		private function getController()
		{
			$route = (empty($_GET['route'])) ? '' : $_GET['route'];
		
			if (empty($route))
			{
				$route = 'index';
			}
			else
			{
				# get the parts of the route
				$parts = explode('/', $route);
				$this->__controller = $parts[0];
				
				if(isset( $parts[1]))
				{
					$this->__action = $parts[1];
				}
			}
		
			if (empty($this->__controller))
			{
				$this->__controller = 'index';
			}
		
			$this->__file_name = $this->__controller;
		
			# Get action
			if (empty($this->__action))
			{
				$this->__action = 'index';
			}
		
			#####
			$this->__controller = preg_replace("/[^a-zA-Z0-9_]+/", "", $this->__controller);
		
			# set the file path
			$this->__file = $this->path .'/'. $this->__controller . 'Controller.php';
		}

	}

?>
 
and here is my template class

    <?php

	class template
	{
		private $template_name;
		private $registry;
		# vars that will be available globally
		private $vars = array();
		
		function __construct($registry)
		{
			$this->registry = $registry;
		}

		public function __set($index, $value)
		{
			$this->vars[$index] = $value;
		}
		
		# show the view
		function show($name)
		{
			# view file path
			$path = __SITE_PATH . '/views/theme/' . __TEMPLATE_NAME . '/' . $name . '.php';
		
			if (file_exists($path) == false)
			{
				throw new Exception('Template not found in '. $path);
				return false;
			}
		
			# Load variables to views
			extract ($this->vars);

      		ob_start();
	  		include ($path);
	  		return ob_end_flush();

			/*
			// Method Two
			
			foreach ($this->vars as $key => $value)
			{
				$$key = $value;
			}
			require ($path);
			*/
			
		}
	}

?>

Thank you for your help

 