private function compileFiles(string $viewPath)
    {
        $directory = new RecursiveDirectoryIterator($viewPath, FilesystemIterator::SKIP_DOTS);

        foreach (new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST) as $file) {
            /** @var SplFileInfo $file */
            if ($file->isFile() && $file->getExtension() === 'twig') {
                $templateName = substr($file->getPathname(), strlen($viewPath) + 1);
                $templateName = str_replace('\\', '/', $templateName);
                //echo sprintf("Parsing: %s\n", $templateName);
                $this->twig->loadTemplate($templateName);
            }
        }
    }