public function render(string $file, array $data) : void
    {
        if (!is_readable($file)) {
            throw new Exception("Could not find template file: " . $this->template);
        }

        $di = $this->di;
        $app = null;
        if ($di->has("app")) {
            $app = $di->get("app");
        }
        extract($data);
        require $file;
    }