classes/Routing/Wildcard.php
public function detectId()
    {
        // If there is an id, it will be the last number
        if (preg_match('#\d+$#', $this->path, $matches)) {
            return $matches[0];
        }

        // .. or the route will be an action preceeded by an id
        $pattern = '#(\d+)/('.implode('|', $this->actions).')$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return $matches[1];
        }

        // There's no id
        return false;
    }
public function detectId()
    {
        // If there is an id, it will be the last number
        if (preg_match('#\d+$#', $this->path, $matches)) {
            return $matches[0];
        }

        // .. or the route will be an action preceeded by an id
        $pattern = '#(\d+)/('.implode('|', $this->actions).')$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return $matches[1];
        }

        // There's no id
        return false;
    }
public function detectId ( ) { // If there is an id, it will be the last number if ( preg_match ( '#\d+$#' , $ this -> path , $ matches ) ) { return $ matches [ 0 ] ; } // .. or the route will be an action preceeded by an id $ pattern = '#(\d+)/(' . implode ( '|' , $ this -> actions ) . ')$#i' ; if ( preg_match ( $ pattern , $ this -> path , $ matches ) ) { return $ matches [ 1 ] ; } // There's no id return false ; }
Detect the id for the path
@return integer An id number for a DB record
Detect the id for the path