public function findTemplate($template)
    {
        $file = $this->basePath("app/Template/$template");
        if($this->findFile($file)) {
            return $file;
        }
        elseif($this->findFile($file.'.html')) {
            return $file.'.html';
        }
        elseif($this->findFile($file.'.php')) {
            return $file.'.php';
        }
        else {
            throw new Exception($file." Template file is missing.");
            exit;
        }
    }