private function createPageCss(string $name, array $data, string $pathFile)
    {
        $minifier = new Minify\CSS("");

        if (!empty($this->param['css']) && is_array($this->param['css'])) {
            foreach ($this->param['css'] as $item) {
                $datum = array_values(array_filter(array_map(function ($d) use ($item) {
                    return $d['nome'] === $item ? $d : [];
                }, $data)));

                if (!empty($datum[0])) {
                    $datum = $datum[0];

                    if (!empty($datum['arquivos'])) {
                        foreach ($datum['arquivos'] as $file) {
                            if ($file['type'] === "text/css")
                                $minifier->add($file['content']);
                        }
                    }
                }
            }
        }

        if (file_exists(PATH_HOME . $pathFile . "assets/{$name}.css"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.css"));
        elseif (file_exists(PATH_HOME . $pathFile . "assets/{$name}.min.css"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.min.css"));

        $minifier->minify(PATH_HOME . "assetsPublic/view/{$name}.min.css");

        //Ajusta diretório dos assets
        $file = file_get_contents(PATH_HOME . "assetsPublic/view/{$name}.min.css");
        $file = str_replace("../", "", $file);
        $f = fopen(PATH_HOME . "assetsPublic/view/{$name}.min.css", "w");
        fwrite($f, $file);
        fclose($f);

    }
private function createPageCss(string $name, array $data, string $pathFile)
    {
        $minifier = new Minify\CSS("");

        if (!empty($this->param['css']) && is_array($this->param['css'])) {
            foreach ($this->param['css'] as $item) {
                $datum = array_values(array_filter(array_map(function ($d) use ($item) {
                    return $d['nome'] === $item ? $d : [];
                }, $data)));

                if (!empty($datum[0])) {
                    $datum = $datum[0];

                    if (!empty($datum['arquivos'])) {
                        foreach ($datum['arquivos'] as $file) {
                            if ($file['type'] === "text/css")
                                $minifier->add($file['content']);
                        }
                    }
                }
            }
        }

        if (file_exists(PATH_HOME . $pathFile . "assets/{$name}.css"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.css"));
        elseif (file_exists(PATH_HOME . $pathFile . "assets/{$name}.min.css"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.min.css"));

        $minifier->minify(PATH_HOME . "assetsPublic/view/{$name}.min.css");

        //Ajusta diretório dos assets
        $file = file_get_contents(PATH_HOME . "assetsPublic/view/{$name}.min.css");
        $file = str_replace("../", "", $file);
        $f = fopen(PATH_HOME . "assetsPublic/view/{$name}.min.css", "w");
        fwrite($f, $file);
        fclose($f);

    }
private function createPageCss ( string $ name , array $ data , string $ pathFile ) { $ minifier = new Minify \ CSS ( "" ) ; if ( ! empty ( $ this -> param [ 'css' ] ) && is_array ( $ this -> param [ 'css' ] ) ) { foreach ( $ this -> param [ 'css' ] as $ item ) { $ datum = array_values ( array_filter ( array_map ( function ( $ d ) use ( $ item ) { return $ d [ 'nome' ] === $ item ? $ d : [ ] ; } , $ data ) ) ) ; if ( ! empty ( $ datum [ 0 ] ) ) { $ datum = $ datum [ 0 ] ; if ( ! empty ( $ datum [ 'arquivos' ] ) ) { foreach ( $ datum [ 'arquivos' ] as $ file ) { if ( $ file [ 'type' ] === "text/css" ) $ minifier -> add ( $ file [ 'content' ] ) ; } } } } } if ( file_exists ( PATH_HOME . $ pathFile . "assets/{$name}.css" ) ) $ minifier -> add ( file_get_contents ( PATH_HOME . $ pathFile . "assets/{$name}.css" ) ) ; elseif ( file_exists ( PATH_HOME . $ pathFile . "assets/{$name}.min.css" ) ) $ minifier -> add ( file_get_contents ( PATH_HOME . $ pathFile . "assets/{$name}.min.css" ) ) ; $ minifier -> minify ( PATH_HOME . "assetsPublic/view/{$name}.min.css" ) ; //Ajusta diretório dos assets $ file = file_get_contents ( PATH_HOME . "assetsPublic/view/{$name}.min.css" ) ; $ file = str_replace ( "../" , "" , $ file ) ; $ f = fopen ( PATH_HOME . "assetsPublic/view/{$name}.min.css" , "w" ) ; fwrite ( $ f , $ file ) ; fclose ( $ f ) ; }
Cria View Assets CSS
@param string $name
@param array $data
@param string $pathFile
Cria View Assets CSS