You are here

public function QuickNodeCloneNodeFinder::currentPathIsValidClonePath in Quick Node Clone 8

Determine if the current page path is a valid quick node clone path.

Return value

bool TRUE if valid, FALSE if invalid.

1 call to QuickNodeCloneNodeFinder::currentPathIsValidClonePath()
QuickNodeCloneNodeFinder::findNodeFromCurrentPath in src/QuickNodeCloneNodeFinder.php
Derive node data from the current path.

File

src/QuickNodeCloneNodeFinder.php, line 142

Class

QuickNodeCloneNodeFinder
Helper class.

Namespace

Drupal\quick_node_clone

Code

public function currentPathIsValidClonePath() {
  $path = $this->requestStack
    ->getCurrentRequest()
    ->getRequestUri();
  $path_data = explode('/', $path);
  if (!isset($path_data[1]) || $path_data[1] != 'clone') {
    return FALSE;
  }
  if (!isset($path_data[2])) {
    return FALSE;
  }
  if (!isset($path_data[3]) || $path_data[3] != 'quick_clone') {
    return FALSE;
  }
  return TRUE;
}