public function render($filename, $vars = array())
    {
        $localTemplate = $this->templateDir . '/' . $filename;
        $themeTemplate = locate_template($filename);

        if (!file_exists($localTemplate) && !file_exists($themeTemplate)) {
            throw new NotFoundException("View at $localTemplate or $themeTemplate not found");
        }

        $this->viewData = $vars;

        $template = file_exists($localTemplate) ? $localTemplate : $themeTemplate;

        ob_start();
        include($template);
        $view = ob_get_contents();
        ob_end_clean();

        return $view;
    }