Closed twolier closed 6 years ago
Yii::$app->redis->exec();
Unknown Property – yii\base\UnknownPropertyException Getting unknown property: yii\web\Application::redis
It looks like you don't have configured redis
component in your app.
Thank you for your question. In order for this issue tracker to be effective, it should only contain bug reports and feature requests.
We advise you to use our community driven resources:
If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.
This is an automated comment, triggered by adding the label question
.
@rob006 it's my fault I'm doing a return here Yii::$app->redis->exec(); So, throw an error Invalid Parameter – yii\base\InvalidParamException Response content must not be an array.
It should look something like this Yii::$app->redis->multi(); ...... Yii::$app->redis->exec(); return true;
Not like that return Yii::$app->redis->exec();
What steps will reproduce the problem?
1. Yii::$app->redis ->multi() ->set('name','hello') ->get('name') ->set('nick','world') ->get('nick') ->exec(); PHP Fatal Error – yii\base\ErrorException Call to a member function set() on boolean
2. Yii::$app->redis->multi(); Yii::$app->redis->set('name','hello'); Yii::$app->redis->get('name'); Yii::$app->redis->set('nick','world'); Yii::$app->redis->get('nick'); Yii::$app->redis->exec();
Unknown Property – yii\base\UnknownPropertyException Getting unknown property: yii\web\Application::redis
What's expected?
Are there any examples ?