You are here

function _social_path_manager_get_path_suffix in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  2. 8.5 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  3. 8.6 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  4. 8.8 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  5. 10.3.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  6. 10.0.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  7. 10.1.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()
  8. 10.2.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_get_path_suffix()

Get the url suffix for a giving route of a group.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group being updated.

string $route: The route of the tab being updated.

Return value

string The url suffix of the tab.

1 call to _social_path_manager_get_path_suffix()
_social_path_manager_update_alias in modules/custom/social_path_manager/social_path_manager.module
Create the aliases for the views of the group.

File

modules/custom/social_path_manager/social_path_manager.module, line 194
The Social Path Manager module.

Code

function _social_path_manager_get_path_suffix(GroupInterface $group, $route) {
  $url = Url::fromRoute($route, [
    'group' => $group
      ->id(),
  ]);

  // Get the last part of the url.
  $url = explode('/', $url
    ->getInternalPath());
  return end($url);
}