Can't get static param value

I have error Unknown Method

Calling unknown method: yii\web\Application::params()

Model:

public static function isSecretKeyExpire($key)
{
    if (empty($key))
        return false;
    $expire = Yii::$app->params('secretKeyExpire');
    $parts = explode('_', $key);
    $timestamp = (int) end($parts);
    return $timestamp + $expire >= time();
}

Upvotes: 0

Views: 125

Answers (2)

ScaisEdge
ScaisEdge

Reputation: 133400

try this way :

 Yii::$app->params['versionDate'];

Upvotes: 2

W. Steve
W. Steve

Reputation: 387

try:

Yii::app()->params['secretKeyExpire']

Upvotes: 0

Related Questions