Classes/ViewHelpers/TargetPageIdViewHelper.php
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
    {
        if (!strpos($arguments['target'], 't3://page', 0) === 0) {
            return '';
        }

        try {
            $linkService = GeneralUtility::makeInstance(LinkService::class);
            $resolvedLink = $linkService->resolveByStringRepresentation($arguments['target']);
            return $resolvedLink['pageuid'] ?? '';
        } catch (UnknownUrnException $e) {
            return '';
        }
    }
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
    {
        if (!strpos($arguments['target'], 't3://page', 0) === 0) {
            return '';
        }

        try {
            $linkService = GeneralUtility::makeInstance(LinkService::class);
            $resolvedLink = $linkService->resolveByStringRepresentation($arguments['target']);
            return $resolvedLink['pageuid'] ?? '';
        } catch (UnknownUrnException $e) {
            return '';
        }
    }
public static function renderStatic ( array $ arguments , \ Closure $ renderChildrenClosure , RenderingContextInterface $ renderingContext ) : string { if ( ! strpos ( $ arguments [ 'target' ] , 't3://page' , 0 ) === 0 ) { return '' ; } try { $ linkService = GeneralUtility :: makeInstance ( LinkService :: class ) ; $ resolvedLink = $ linkService -> resolveByStringRepresentation ( $ arguments [ 'target' ] ) ; return $ resolvedLink [ 'pageuid' ] ?? '' ; } catch ( UnknownUrnException $ e ) { return '' ; } }
Renders the page ID

@param array $arguments
@param \Closure $renderChildrenClosure
@param RenderingContextInterface $renderingContext
@return string
Renders the page ID