You are here

function gin_lb_is_layout_builder_route in Gin Layout Builder 1.0.x

Returns true if the current route is a layout builder route.

Return value

bool Returns true for layout builder routes.

3 calls to gin_lb_is_layout_builder_route()
gin_lb_css_alter in ./gin_lb.module
Implements hook_css_alter().
gin_lb_page_attachments in ./gin_lb.module
Implements hook_page_attachments().
gin_lb_theme_suggestions_alter in ./gin_lb.module
Implements hook_theme_suggestions_alter().

File

./gin_lb.module, line 366
Provides hooks for gin_lb module.

Code

function gin_lb_is_layout_builder_route() {
  $gin_lb_is_layout_builder_route = drupal_static(__FUNCTION__);
  if ($gin_lb_is_layout_builder_route !== NULL) {
    return $gin_lb_is_layout_builder_route;
  }
  $rout_match = \Drupal::routeMatch();
  $route_name = $rout_match
    ->getRouteName();
  $gin_lb_is_layout_builder_route = FALSE;
  if (preg_match('/^(layout_builder\\.([^.]+\\.)?)/', $route_name)) {
    $gin_lb_is_layout_builder_route = TRUE;
  }
  \Drupal::moduleHandler()
    ->alter('gin_lb_is_layout_builder_route', $gin_lb_is_layout_builder_route, $context);
  return $gin_lb_is_layout_builder_route;
}