You are here

protected function ColorboxFieldFormatterEntityreference::getUrl in Colorbox field formatter 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldFormatter/ColorboxFieldFormatterEntityreference.php \Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatter\ColorboxFieldFormatterEntityreference::getUrl()

Parameters

\Drupal\Core\Field\FieldItemInterface $item: One field item.

Return value

\Drupal\Core\Url

Throws

\Drupal\Core\Entity\EntityMalformedException

Overrides ColorboxFieldFormatter::getUrl

File

src/Plugin/Field/FieldFormatter/ColorboxFieldFormatterEntityreference.php, line 43

Class

ColorboxFieldFormatterEntityreference
Plugin implementation of the 'colorbox_field_formatter' formatter for entityreferences.

Namespace

Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatter

Code

protected function getUrl(FieldItemInterface $item) : Url {

  /** @noinspection PhpUndefinedFieldInspection */
  return $item->entity
    ->toUrl();
}