You are here

class ViewsBadge in Link Badges 8

Same name in this branch
  1. 8 src/Plugin/LinkBadge/ViewsBadge.php \Drupal\link_badges\Plugin\LinkBadge\ViewsBadge
  2. 8 src/Plugin/Derivative/ViewsBadge.php \Drupal\link_badges\Plugin\Derivative\ViewsBadge

Class ViewsBadge

Plugin annotation


@LinkBadge(
 id = "views_badge",
 deriver = "Drupal\link_badges\Plugin\Derivative\ViewsBadge"
)

Hierarchy

Expanded class hierarchy of ViewsBadge

File

src/Plugin/LinkBadge/ViewsBadge.php, line 16

Namespace

Drupal\link_badges\Plugin\LinkBadge
View source
class ViewsBadge extends LinkBadgeBase {
  public $name;
  public $display_id;

  /**
   * {@inheritdoc}
   */
  public function getBadgeValue() {
    $result = views_embed_view($this->name, $this->display_id);
    return drupal_render($result);
  }

}

Members