BibciteLinkPluginBase.php in Bibliography & Citation 2.0.x
File
modules/bibcite_entity/src/Plugin/BibciteLinkPluginBase.php
View source
<?php
namespace Drupal\bibcite_entity\Plugin;
use Drupal\bibcite_entity\Entity\ReferenceInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Link;
abstract class BibciteLinkPluginBase extends PluginBase implements BibciteLinkPluginInterface {
public function getLabel() {
return $this->pluginDefinition['label'];
}
protected function buildUrl(ReferenceInterface $reference) {
}
public function build(ReferenceInterface $reference) {
if ($url = $this
->buildUrl($reference)) {
return Link::fromTextAndUrl($this
->getLabel(), $url)
->toRenderable();
}
return NULL;
}
}