You are here

function crazyegg_is_page_allowed in Crazy Egg Integration 8

Same name and namespace in other branches
  1. 7 crazyegg.module \crazyegg_is_page_allowed()

Check if actual page URL matches patterns listed in `crazyegg_paths` variable. If the variable is empty, return true.

Return value

bool

1 call to crazyegg_is_page_allowed()
crazyegg_page_attachments in ./crazyegg.module
Implements hook_page_attachments(). Checks all conditions and if they are met, injects Crazy Egg tracking script into the page

File

./crazyegg.module, line 108

Code

function crazyegg_is_page_allowed() {
  $paths = \Drupal::config('crazyegg.settings')
    ->get('crazyegg_paths');
  $url = Url::fromRoute('<current>')
    ->toString();
  return empty($paths) or \Drupal::service('path.matcher')
    ->matchPath($url, $paths);
}