无法获取静态参数值

Can't get static param value

我有错误未知方法

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

型号:

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();
}

尝试:

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

试试这个方法:

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