protected function getTemplate($name, array $data)
    {
        $template = App::instance()->template($name);

        if (!$template->exists()) {
            throw new Exception("The template '{$name}' does not exist.");
        }

        return $template->render($data);
    }