public static function link($menu, $text, array $options = [], array $fields = [])
    {
        if ($menu instanceof ActiveRecord) {

            if (!$fields) {
                $fields = self::$fields;
            }

            if ($menu->{$fields['page_blank']}) {
                $options['target'] = '_blank';
            }

            return Html::a($text, self::linkUrl(
                $menu->{$fields['page_id']},
                $menu->{$fields['page_url']}
            ), $options);
        }

        return false;
    }
public static function link($menu, $text, array $options = [], array $fields = [])
    {
        if ($menu instanceof ActiveRecord) {

            if (!$fields) {
                $fields = self::$fields;
            }

            if ($menu->{$fields['page_blank']}) {
                $options['target'] = '_blank';
            }

            return Html::a($text, self::linkUrl(
                $menu->{$fields['page_id']},
                $menu->{$fields['page_url']}
            ), $options);
        }

        return false;
    }
public static function link ( $ menu , $ text , array $ options = [ ] , array $ fields = [ ] ) { if ( $ menu instanceof ActiveRecord ) { if ( ! $ fields ) { $ fields = self :: $ fields ; } if ( $ menu -> { $ fields [ 'page_blank' ] } ) { $ options [ 'target' ] = '_blank' ; } return Html :: a ( $ text , self :: linkUrl ( $ menu -> { $ fields [ 'page_id' ] } , $ menu -> { $ fields [ 'page_url' ] } ) , $ options ) ; } return false ; }
Display link by page
@param mixed $menu
@param $text Html:a text
@param array $options Html:a options
@param array $fields
@return bool|string
@throws \yii\base\InvalidConfigException
Display link by page