static function getContentFilePath(string $contentPath)
    {
        $pathComponents = Request::getPathSegments();
        
        // check for regular file in content directory.
        $requestFilePath = $contentPath;
        foreach ($pathComponents as $index => $pathComponent) {
            if (trim($pathComponent) != "" && ($index != 0 || $pathComponent !== INDEX_FILE)) {
                $requestFilePath .= '/' . $pathComponent;
                if (is_file($requestFilePath)) {
                    return $requestFilePath;
                }
            }
        }
        
        return null;
    }
static function getContentFilePath(string $contentPath)
    {
        $pathComponents = Request::getPathSegments();
        
        // check for regular file in content directory.
        $requestFilePath = $contentPath;
        foreach ($pathComponents as $index => $pathComponent) {
            if (trim($pathComponent) != "" && ($index != 0 || $pathComponent !== INDEX_FILE)) {
                $requestFilePath .= '/' . $pathComponent;
                if (is_file($requestFilePath)) {
                    return $requestFilePath;
                }
            }
        }
        
        return null;
    }
static function getContentFilePath ( string $ contentPath ) { $ pathComponents = Request :: getPathSegments ( ) ; // check for regular file in content directory. $ requestFilePath = $ contentPath ; foreach ( $ pathComponents as $ index => $ pathComponent ) { if ( trim ( $ pathComponent ) != "" && ( $ index != 0 || $ pathComponent !== INDEX_FILE ) ) { $ requestFilePath .= '/' . $ pathComponent ; if ( is_file ( $ requestFilePath ) ) { return $ requestFilePath ; } } } return null ; }
Get the absolute path to the file in the specified content directory for the current request.

@param string $contentPath
The content directory to search.

@return string Absolute path to the file for the current request or NULL if it could not be resolved.
Get the absolute path to the file in the specified content directory for the current request .