public function asCrudLink($value, $options = [], $action = 'view', $label = null)
    {
        if ($value === null || (is_array($value) && empty($value))) {
            return $this->nullDisplay;
        }
        $values = is_array($value) ? $value : [$value];

        $route = false;
        $result = [];
        foreach ($values as $value) {
            if ($label === null) {
                $labelString = Html::encode((string)$value);
            } elseif (is_callable($label)) {
                $labelString = call_user_func($label, $value);
            } else {
                $labelString = $label;
            }
            if (!$value instanceof ActiveRecord) {
                $result[] = $labelString;
                continue;
            }
            if ($route === false) {
                $route = Yii::$app->crudModelsMap[$value::className()];
            }
            if ($route === null || !Yii::$app->user->can($value::className().'.read', ['model' => $value])) {
                $result[] = $labelString;
                continue;
            }

            $result[] = Html::a($labelString, [
                $route . '/' . $action,
                'id' => Action::exportKey($value->getPrimaryKey()),
            ], $options);
        }
        return implode(', ', $result);
    }