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

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

                if ($entry != '..' && $entry != '.' && is_dir($fullPath)) {
                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $patterns[] = new Pattern($id);
                }
            }

            closedir($handle);
        }

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

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

                if ($entry != '..' && $entry != '.' && is_dir($fullPath)) {
                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $patterns[] = new Pattern($id);
                }
            }

            closedir($handle);
        }

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

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