function LinkWidget::isNoLinkRoute

Same name and namespace in other branches
  1. main core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php \Drupal\link\Plugin\Field\FieldWidget\LinkWidget::isNoLinkRoute()

Checks if a given route name is one of Drupal's special no-link routes.

Parameters

string $route: The route name.

Return value

bool TRUE if the route is a no-link route, FALSE otherwise.

2 calls to LinkWidget::isNoLinkRoute()
LinkWidget::getUriAsDisplayableString in core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
Gets the URI without the 'internal:' or 'entity:' scheme.
LinkWidget::getUserEnteredStringAsUri in core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
Gets the user-entered string as a URI.

File

core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php, line 519

Class

LinkWidget
Plugin implementation of the 'link' widget.

Namespace

Drupal\link\Plugin\Field\FieldWidget

Code

protected static function isNoLinkRoute(string $route) : bool {
  return in_array($route, [
    '<nolink>',
    '<none>',
    '<button>',
  ], TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.