You are here

private function RestMenuItemsResource::addFragment in Rest menu items 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/rest/resource/RestMenuItemsResource.php \Drupal\rest_menu_items\Plugin\rest\resource\RestMenuItemsResource::addFragment()

Add the fragment to the value if neccesary.

Parameters

string $value: The value to add the fragment to. Passed by reference.

\Drupal\Core\Menu\MenuLinkInterface $link: The link from the menu.

1 call to RestMenuItemsResource::addFragment()
RestMenuItemsResource::getElementValue in src/Plugin/rest/resource/RestMenuItemsResource.php
Generate the menu element value.

File

src/Plugin/rest/resource/RestMenuItemsResource.php, line 418

Class

RestMenuItemsResource
Provides a resource to get bundles by entity.

Namespace

Drupal\rest_menu_items\Plugin\rest\resource

Code

private function addFragment(&$value, $link) {
  $options = $link
    ->getOptions();
  if (!empty($options) && isset($options['fragment'])) {
    $value .= '#' . $options['fragment'];
  }
}