/** * Generates multiple media objects. * @param array $items item configurations. * @param string $tag the item tag name. * @return string generated objects. */ public static function medias(array $items, $tag = 'div') { if (!empty($items)) { $output = ''; foreach ($items as $itemOptions) { if (isset($itemOptions['visible']) && $itemOptions['visible'] === false) { continue; } // todo: consider removing the support for htmlOptions. $options = \bootstrap\helpers\BSArray::popValue('htmlOptions', $itemOptions, array()); if (!empty($options)) { $itemOptions = \bootstrap\helpers\BSArray::merge($options, $itemOptions); } $image = \bootstrap\helpers\BSArray::popValue('image', $itemOptions); $heading = \bootstrap\helpers\BSArray::popValue('heading', $itemOptions, ''); $content = \bootstrap\helpers\BSArray::popValue('content', $itemOptions, ''); \bootstrap\helpers\BSArray::defaultValue('tag', $tag, $itemOptions); $output .= self::media($image, $heading, $content, $itemOptions); } return $output; } return ''; }