public static function linkUrl($pageId, $pageUrl)
    {
        if (self::$pages === null) {
            self::initPages();
        }

        if ($pageUrl) {
            if (strpos($pageUrl, 'http') === 0) {
                return Url::to($pageUrl);
            }

            return Url::to([$pageUrl]);
        }

        if (isset(self::$pages[$pageId]['link'])) {
            if (self::$pages[$pageId]['link']) {
                return Url::to(['/' . self::$pages[$pageId]['link']]);
            }
        }

        return Url::home();
    }
public static function linkUrl($pageId, $pageUrl)
    {
        if (self::$pages === null) {
            self::initPages();
        }

        if ($pageUrl) {
            if (strpos($pageUrl, 'http') === 0) {
                return Url::to($pageUrl);
            }

            return Url::to([$pageUrl]);
        }

        if (isset(self::$pages[$pageId]['link'])) {
            if (self::$pages[$pageId]['link']) {
                return Url::to(['/' . self::$pages[$pageId]['link']]);
            }
        }

        return Url::home();
    }
public static function linkUrl ( $ pageId , $ pageUrl ) { if ( self :: $ pages === null ) { self :: initPages ( ) ; } if ( $ pageUrl ) { if ( strpos ( $ pageUrl , 'http' ) === 0 ) { return Url :: to ( $ pageUrl ) ; } return Url :: to ( [ $ pageUrl ] ) ; } if ( isset ( self :: $ pages [ $ pageId ] [ 'link' ] ) ) { if ( self :: $ pages [ $ pageId ] [ 'link' ] ) { return Url :: to ( [ '/' . self :: $ pages [ $ pageId ] [ 'link' ] ] ) ; } } return Url :: home ( ) ; }
Get page url by id
@param $pageId
@param $pageUrl
@return string
@throws \yii\base\InvalidConfigException
Get page url by id