You are here

AJAXactionLink.php in Flag Lists 8

Same filename and directory in other branches
  1. 4.0.x src/Plugin/ActionLink/AJAXactionLink.php

File

src/Plugin/ActionLink/AJAXactionLink.php
View source
<?php

namespace Drupal\flag_lists\Plugin\ActionLink;

use Drupal\Core\Entity\EntityInterface;
use Drupal\flag\FlagInterface;
use Drupal\flag\Plugin\ActionLink\AJAXactionLink as FlagAJAXactionLink;

/**
 * Provides the AJAX link type.
 *
 * This class is an extension of the Reload link type, but modified to
 * provide AJAX links.
 *
 * @ActionLinkType(
 *   id = "ajax_link",
 *   label = @Translation("AJAX link"),
 *   description = "An AJAX JavaScript request will be made without
 *   reloading the page."
 * )
 */
class AJAXactionLink extends FlagAJAXactionLink {

  /**
   * {@inheritdoc}
   *
   * Currently a stub only.
   */
  public function getAsFlagLink(FlagInterface $flag, EntityInterface $entity) {
    $build = parent::getAsFlagLink($flag, $entity);

    // $build['#flagging_collection'] = 'text'.
    return $build;
  }

}

Classes

Namesort descending Description
AJAXactionLink Provides the AJAX link type.