protected function EntityReferenceFacetUrl::buildElement in Entity Reference Facet Link 8
Builds a single element's render array.
Parameters
\Drupal\Core\Url $url: The processed facet URL.
\Drupal\Core\Entity\EntityInterface $entity: The entity being displayed.
Return value
array A render array.
Overrides EntityReferenceFacetFormatterBase::buildElement
File
- src/
Plugin/ Field/ FieldFormatter/ EntityReferenceFacetUrl.php, line 25
Class
- EntityReferenceFacetUrl
- Plugin implementation of the 'entity reference facet url' formatter.
Namespace
Drupal\entity_reference_facet_link\Plugin\Field\FieldFormatterCode
protected function buildElement(Url $url, EntityInterface $entity) {
return [
'#markup' => $url
->toString(),
];
}