public function getLocalLabel($attribute, $language = null)
    {
        if ($language === null) {
            $language = \Yii::$app->language;
        }
        /** @var ActiveRecord $owner */
        $owner = $this->owner;
        if ($owner->isNewRecord) {
            return $owner->getAttribute($attribute);
        }
        $localLabels = $this->getLocalLabels();

        return !isset($localLabels[$language][$owner->getPrimaryKey()][$attribute])
            ? $owner->getAttribute($attribute)
            : $localLabels[$language][$owner->getPrimaryKey()][$attribute];
    }
public function getLocalLabel($attribute, $language = null)
    {
        if ($language === null) {
            $language = \Yii::$app->language;
        }
        /** @var ActiveRecord $owner */
        $owner = $this->owner;
        if ($owner->isNewRecord) {
            return $owner->getAttribute($attribute);
        }
        $localLabels = $this->getLocalLabels();

        return !isset($localLabels[$language][$owner->getPrimaryKey()][$attribute])
            ? $owner->getAttribute($attribute)
            : $localLabels[$language][$owner->getPrimaryKey()][$attribute];
    }
public function getLocalLabel ( $ attribute , $ language = null ) { if ( $ language === null ) { $ language = \ Yii :: $ app -> language ; } /** @var ActiveRecord $owner */ $ owner = $ this -> owner ; if ( $ owner -> isNewRecord ) { return $ owner -> getAttribute ( $ attribute ) ; } $ localLabels = $ this -> getLocalLabels ( ) ; return ! isset ( $ localLabels [ $ language ] [ $ owner -> getPrimaryKey ( ) ] [ $ attribute ] ) ? $ owner -> getAttribute ( $ attribute ) : $ localLabels [ $ language ] [ $ owner -> getPrimaryKey ( ) ] [ $ attribute ] ; }
Returnes a localized value of an attribute.
@param string $attribute
@param string $language if null, defaults to app language
@return string
Returnes a localized value of an attribute .