You are here

protected function RouteConditionCreator::getPathPattern in Block Visibility Groups 8

Return value

mixed|string

2 calls to RouteConditionCreator::getPathPattern()
RouteConditionCreator::createConditionElements in block_visibility_groups_admin/src/Plugin/ConditionCreator/RouteConditionCreator.php
Create condition elements for form.
RouteConditionCreator::getNewConditionLabel in block_visibility_groups_admin/src/Plugin/ConditionCreator/RouteConditionCreator.php
Get the label when creating a new condition.

File

block_visibility_groups_admin/src/Plugin/ConditionCreator/RouteConditionCreator.php, line 29

Class

RouteConditionCreator
Defines the form in-place editor.

Namespace

Drupal\block_visibility_groups_admin\Plugin\ConditionCreator

Code

protected function getPathPattern() {
  $route = $this->route
    ->getRouteObject();
  $path = $route
    ->getPath();
  $parameters = $route
    ->compile()
    ->getPathVariables();
  foreach ($parameters as $parameter) {
    $path = str_replace('{' . $parameter . '}', '*', $path);
  }
  return $path;
}