How To Use Yii2/redis

$redis = new \Redis();





How to use redis->hmset with yii2/redis like above?

The following code does not work!

'components' => [




                'port' => 9002,

                'database' => 1,




How exactly it does not work?


PHP Warning – yii\base\ErrorException

mb_strlen() expects parameter 1 to be string, array given

yii\redis\Connection line 357

simply serialize your array


If the array is serialized,how can I get the value by using

$redis->hmGet('key', array('name'));