Bootstrapper\MediaObject::renderItem PHP Method

renderItem() protected method

Renders an item in the string
protected renderItem ( array $contents, string $tag ) : string
$contents array
$tag string The tag to wrap the item in
return string
    protected function renderItem(array $contents, $tag)
    {
        $position = $this->getPosition($contents);
        $heading = $this->getHeading($contents);
        $image = $this->getImage($contents, $heading);
        $link = $this->getLink($contents, $image, $position);
        $body = $this->getBody($contents);
        $attributes = new Attributes($this->attributes, ['class' => 'media']);
        $string = "<{$tag} {$attributes}>";
        $string .= $link;
        $string .= "<div class='media-body'>";
        if ($heading) {
            $string .= "<h4 class='media-heading'>{$heading}</h4>";
        }
        $string .= $body;
        $string .= "</div></{$tag}>";
        return $string;
    }