static function getInstance($driver)
    {

        if (isset(self::$instances[$driver])) {
            return self::$instances[$driver];
        }

        $driverConfig = TemplateEngine::getConfig()->get('Engines.' . $driver, false);
        if (!$driverConfig) {
            throw new TemplateEngineException('Unable to read driver configuration: TemplateEngine.Engines.' . $driver);
        }

        try {
            self::$instances[$driver] = TemplateEngineBridge::getInstance($driver, $driverConfig);

            return self::$instances[$driver];
        } catch (\Exception $e) {
            throw $e;
        }
    }