You are here

public function ModalPageService::verifyModalShouldAppearOnThisPath in Modal 4.1.x

Same name and namespace in other branches
  1. 4.0.x src/Service/ModalPageService.php \Drupal\modal_page\Service\ModalPageService::verifyModalShouldAppearOnThisPath()

Verify if this Modal Should Appear on This Path.

Return value

bool Return TRUE or FALSE.

1 call to ModalPageService::verifyModalShouldAppearOnThisPath()
ModalPageService::getModalToShowByPage in src/Service/ModalPageService.php
Get the modal by page.

File

src/Service/ModalPageService.php, line 419

Class

ModalPageService
Modal Page Service Class.

Namespace

Drupal\modal_page\Service

Code

public function verifyModalShouldAppearOnThisPath($path, $currentPath) {
  $path = preg_quote($path, '/');
  $path = str_replace('\\*', '.*', $path);
  return preg_match('/^' . $path . '$/i', $currentPath);
}