protected function compileTemplate($templateFile, array $templateData)
    {
        if (!isset(self::$compiler)) {
            self::$compiler = new Compiler();
        }

        if (!is_file($templateFile)) {
            throw new Exception("Could not find template file '$templateFile'.");
        }

        return self::$compiler->compile(file_get_contents($templateFile), $templateData);
    }