src/Primer/Renderable/Group.php
public static function loadPatternsInPath($path)
    {
        $groups = array();

        if ($handle = opendir($path)) {

            while (false !== ($entry = readdir($handle))) {
                
                $fullPath = $path . '/' . $entry;

                if (substr($entry, 0, 1) !== '.') {

                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $groups[] = new Group($id);
                }
            }

            closedir($handle);
        }

        return $groups;
    }
public static function loadPatternsInPath($path)
    {
        $groups = array();

        if ($handle = opendir($path)) {

            while (false !== ($entry = readdir($handle))) {
                
                $fullPath = $path . '/' . $entry;

                if (substr($entry, 0, 1) !== '.') {

                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $groups[] = new Group($id);
                }
            }

            closedir($handle);
        }

        return $groups;
    }
public static function loadPatternsInPath ( $ path ) { $ groups = array ( ) ; if ( $ handle = opendir ( $ path ) ) { while ( false !== ( $ entry = readdir ( $ handle ) ) ) { $ fullPath = $ path . '/' . $ entry ; if ( substr ( $ entry , 0 , 1 ) !== '.' ) { $ id = trim ( str_replace ( Primer :: $ PATTERN_PATH , '' , $ fullPath ) , '/' ) ; // Load the pattern $ groups [ ] = new Group ( $ id ) ; } } closedir ( $ handle ) ; } return $ groups ; }
Helper function to load all groups in a folder

@param  String $path The path of the directory to load from
@return Array       Array of all groups loaded
Helper function to load all groups in a folder