public static function saveResource($view, $localized, $path, $filename, $config, $pathPermissions = 0764, $flags = "") {
        $view = str_start($view, "sirgrimorum::templates.");
        $modeloClass = $config['modelo'];
        $modeloM = ucfirst(basename($config['modelo']));
        $modelo = strtolower($modeloM);
        $searchArr = ["{?php}", "{php?}", "[[", "]]", "[!!", "!!]", "{modelo}", "{Modelo}", "{model}", "{Model}", "*extends", "*section", "*stop", "*stack", "*push", "*if", "*else", "*foreach", "*end", "{ " . $modelo . " }"];
        $replaceArr = ["<?php", "?>", "{{", "}}", "{!!", "!!}", $modelo, $modeloM, $modelo, $modeloM, "@extends", "@section", "@stop", "@stack", "@push", "@if", "@else", "@foreach", "@end", "{" . $modelo . "}"];
        $contenido = view($view, ["config" => $config, "localized" => $localized, "modelo" => $modelo])->render();
        $contenido = str_replace($searchArr, $replaceArr, $contenido);

        if (substr($path, strlen($path) - 1) == "/" || substr($path, strlen($path) - 1) == "\\") {
            $path = substr($path, 0, strlen($path) - 1);
        }
        if (!file_exists($path)) {
            mkdir($path, $pathPermissions, true);
        }
        $path = str_finish(str_replace([ "/"], [ "\\"], $path . str_start($filename, "/")), '.php');
        //echo "<pre>" . print_r([$path,$contenido], true) . "</pre>";
        if ($flags == "append") {
            return file_put_contents($path, $contenido, FILE_APPEND);
        } else {
            return file_put_contents($path, $contenido);
        }
    }