classes/Routing/Wildcard.php
public function detectParent()
    {
        // Look for a string, then a number (the parent id), followed by a non-action
        // string, then possiby a number and/or an action string and then the end
        $pattern = '#([a-z-]+)/(\d+)/(?!'.implode('|', $this->actions).')[a-z-]+(?:/\d+)?(/('.implode('|', $this->actions).'))?$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return [$matches[1], $matches[2]];
        }

        return false;
    }
public function detectParent()
    {
        // Look for a string, then a number (the parent id), followed by a non-action
        // string, then possiby a number and/or an action string and then the end
        $pattern = '#([a-z-]+)/(\d+)/(?!'.implode('|', $this->actions).')[a-z-]+(?:/\d+)?(/('.implode('|', $this->actions).'))?$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return [$matches[1], $matches[2]];
        }

        return false;
    }
public function detectParent ( ) { // Look for a string, then a number (the parent id), followed by a non-action // string, then possiby a number and/or an action string and then the end $ pattern = '#([a-z-]+)/(\d+)/(?!' . implode ( '|' , $ this -> actions ) . ')[a-z-]+(?:/\d+)?(/(' . implode ( '|' , $ this -> actions ) . '))?$#i' ; if ( preg_match ( $ pattern , $ this -> path , $ matches ) ) { return [ $ matches [ 1 ] , $ matches [ 2 ] ] ; } return false ; }
Detect the parent id of the path

@return mixed False or an array containing:
- The slug of the parent controller
- The id of the parent record
Detect the parent id of the path