public function fetch(array $options = [], array $modifyVars = [])
    {
        if (empty($options['overwrite'])) {
            $options['overwrite'] = true;
        }
        $overwrite = $options['overwrite'];
        unset($options['overwrite']);

        $matches = $css = $less = [];
        preg_match_all('@(<link[^>]+>)@', $this->_View->fetch('css'), $matches);

        if (empty($matches)) {
            return null;
        }

        $matches = array_shift($matches);

        foreach ($matches as $stylesheet) {
            if (strpos($stylesheet, 'rel="stylesheet/less"') !== false) {
                $match = [];
                preg_match('@href="([^"]+)"@', $stylesheet, $match);
                $file = rtrim(array_pop($match), '?');
                array_push($less, $this->less($file, $options, $modifyVars));
                continue;
            }
            array_push($css, $stylesheet);
        }

        if ($overwrite) {
            $this->_View->Blocks->set('css', join($css));
        }

        return join($less);
    }
public function fetch(array $options = [], array $modifyVars = [])
    {
        if (empty($options['overwrite'])) {
            $options['overwrite'] = true;
        }
        $overwrite = $options['overwrite'];
        unset($options['overwrite']);

        $matches = $css = $less = [];
        preg_match_all('@(<link[^>]+>)@', $this->_View->fetch('css'), $matches);

        if (empty($matches)) {
            return null;
        }

        $matches = array_shift($matches);

        foreach ($matches as $stylesheet) {
            if (strpos($stylesheet, 'rel="stylesheet/less"') !== false) {
                $match = [];
                preg_match('@href="([^"]+)"@', $stylesheet, $match);
                $file = rtrim(array_pop($match), '?');
                array_push($less, $this->less($file, $options, $modifyVars));
                continue;
            }
            array_push($css, $stylesheet);
        }

        if ($overwrite) {
            $this->_View->Blocks->set('css', join($css));
        }

        return join($less);
    }
public function fetch ( array $ options = [ ] , array $ modifyVars = [ ] ) { if ( empty ( $ options [ 'overwrite' ] ) ) { $ options [ 'overwrite' ] = true ; } $ overwrite = $ options [ 'overwrite' ] ; unset ( $ options [ 'overwrite' ] ) ; $ matches = $ css = $ less = [ ] ; preg_match_all ( '@(<link[^>]+>)@' , $ this -> _View -> fetch ( 'css' ) , $ matches ) ; if ( empty ( $ matches ) ) { return null ; } $ matches = array_shift ( $ matches ) ; foreach ( $ matches as $ stylesheet ) { if ( strpos ( $ stylesheet , 'rel="stylesheet/less"' ) !== false ) { $ match = [ ] ; preg_match ( '@href="([^"]+)"@' , $ stylesheet , $ match ) ; $ file = rtrim ( array_pop ( $ match ) , '?' ) ; array_push ( $ less , $ this -> less ( $ file , $ options , $ modifyVars ) ) ; continue ; } array_push ( $ css , $ stylesheet ) ; } if ( $ overwrite ) { $ this -> _View -> Blocks -> set ( 'css' , join ( $ css ) ) ; } return join ( $ less ) ; }
Fetches less stylesheets added to css block
and compiles them

@param  array $options     Options passed to less method.
@param  array $modifyVars  ModifyVars passed to less method.
@return string             Resulting parsed files.
Fetches less stylesheets added to css block and compiles them