src/Mmi/Mvc/ViewHelper/HeadStyle.php
protected function _filterCssFile($fileName)
    {
        try {
            //pobranie kontentu
            $content = file_get_contents(BASE_PATH . '/web/' . $fileName);
        } catch (\Exception $e) {
            return '/* CSS file not found: ' . $fileName . ' */';
        }
        //lokalizacja zasobów z uwzględnieniem baseUrl
        $location = $this->view->baseUrl . '/' . trim(dirname($fileName), '/') . '/';
        //usuwanie nowych linii i tabów
        return preg_replace(['/\r\n/', '/\n/', '/\t/'], '', str_replace(['url(\'', 'url("'], ['url(\'' . $location, 'url("' . $location], $content));
    }
protected function _filterCssFile($fileName)
    {
        try {
            //pobranie kontentu
            $content = file_get_contents(BASE_PATH . '/web/' . $fileName);
        } catch (\Exception $e) {
            return '/* CSS file not found: ' . $fileName . ' */';
        }
        //lokalizacja zasobów z uwzględnieniem baseUrl
        $location = $this->view->baseUrl . '/' . trim(dirname($fileName), '/') . '/';
        //usuwanie nowych linii i tabów
        return preg_replace(['/\r\n/', '/\n/', '/\t/'], '', str_replace(['url(\'', 'url("'], ['url(\'' . $location, 'url("' . $location], $content));
    }
protected function _filterCssFile ( $ fileName ) { try { //pobranie kontentu $ content = file_get_contents ( BASE_PATH . '/web/' . $ fileName ) ; } catch ( \ Exception $ e ) { return '/* CSS file not found: ' . $ fileName . ' */' ; } //lokalizacja zasobów z uwzględnieniem baseUrl $ location = $ this -> view -> baseUrl . '/' . trim ( dirname ( $ fileName ) , '/' ) . '/' ; //usuwanie nowych linii i tabów return preg_replace ( [ '/\r\n/' , '/\n/' , '/\t/' ] , '' , str_replace ( [ 'url(\'' , 'url("' ] , [ 'url(\'' . $ location , 'url("' . $ location ] , $ content ) ) ; }
Zwraca wyfiltrowany CSS
@param string $fileName
@return string
Zwraca wyfiltrowany CSS