src/Primer/Primer.php
public function getPatterns($ids, $showChrome = true)
    {
        $renderList = new RenderList();

        foreach ($ids as $id) {
            $id = Primer::cleanId($id);

            // Check if the Id is for a pattern or a group
            $parts = explode('/', $id);
            if (count($parts) > 2) {
                // It's a pattern
                $renderList->add(new Pattern($id));
            } elseif (count($parts) > 1) {
                // It's a group
                $renderList->add(new Group($id));
            } else {
                // It's a section (e.g. all elements or all components)
                $renderList->add(new Section($id));
            }
        }

        return $this->prepareViewForPatterns($renderList, $showChrome);
    }
public function getPatterns($ids, $showChrome = true)
    {
        $renderList = new RenderList();

        foreach ($ids as $id) {
            $id = Primer::cleanId($id);

            // Check if the Id is for a pattern or a group
            $parts = explode('/', $id);
            if (count($parts) > 2) {
                // It's a pattern
                $renderList->add(new Pattern($id));
            } elseif (count($parts) > 1) {
                // It's a group
                $renderList->add(new Group($id));
            } else {
                // It's a section (e.g. all elements or all components)
                $renderList->add(new Section($id));
            }
        }

        return $this->prepareViewForPatterns($renderList, $showChrome);
    }
public function getPatterns ( $ ids , $ showChrome = true ) { $ renderList = new RenderList ( ) ; foreach ( $ ids as $ id ) { $ id = Primer :: cleanId ( $ id ) ; // Check if the Id is for a pattern or a group $ parts = explode ( '/' , $ id ) ; if ( count ( $ parts ) > 2 ) { // It's a pattern $ renderList -> add ( new Pattern ( $ id ) ) ; } elseif ( count ( $ parts ) > 1 ) { // It's a group $ renderList -> add ( new Group ( $ id ) ) ; } else { // It's a section (e.g. all elements or all components) $ renderList -> add ( new Section ( $ id ) ) ; } } return $ this -> prepareViewForPatterns ( $ renderList , $ showChrome ) ; }
Get a selection of patterns

@param  Array  $ids        An array of pattern/group/section ids
@param  boolean $showChrome Should we show the chrome
@return String
Get a selection of patterns