一个redis INFO:-ERR'info'命令的参数个数错误(A redis INFO: -ERR wrong number of arguments for 'info' command)
所以我刚刚运行了INFO命令,如http://redis.io/commands/info所述
但它只给我默认部分 - 如cpu信息和其他
当我尝试添加
[section]
参数 - 它出错了:telnet 127.0.0.1 6379 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. INFO keyspace -ERR wrong number of arguments for 'info' command INFO all -ERR wrong number of arguments for 'info' command
那么如何获得INFO命令的键空间部分?
so i just ran INFO command as described here http://redis.io/commands/info
but it gives me only default sections - like cpu info and other
and when i try to add
[section]
parameter - it goes wrong:telnet 127.0.0.1 6379 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. INFO keyspace -ERR wrong number of arguments for 'info' command INFO all -ERR wrong number of arguments for 'info' command
so how do i get keyspace section of INFO command?
原文:https://stackoverflow.com/questions/21632845
满意答案
为了解释,
$totalDays
在小部件中不可用,因为整个函数仅在呈现小部件时运行,不再声明$totalDays
。 正如@arogachev上面暗示的那样,您需要在模型中制作$totalDays
,然后才能访问它。 在你的模型中试试这个;public function getTotalDays(){ //Your logic here to generate totalDays return $totalDays; }
然后你可以在你的视图中使用它;
[ 'attribute' => 'class_id', 'format' => 'raw', 'label' => "Class Date", 'value' => function ($model) { array_push($model->totalDays, totalDays,$model->class->date); return $model->class->date; }, 'footer'=> '<span>Total Days</span>', ],
To explain,
$totalDays
is not available in the widget because the whole function only gets run when the widget is rendered,$totalDays
is no longer declared. As @arogachev hinted above, you will need to make$totalDays
in your model, then you can access it. Try this in your model;public function getTotalDays(){ //Your logic here to generate totalDays return $totalDays; }
Then you can use it in your view like this;
[ 'attribute' => 'class_id', 'format' => 'raw', 'label' => "Class Date", 'value' => function ($model) { array_push($model->totalDays, totalDays,$model->class->date); return $model->class->date; }, 'footer'=> '<span>Total Days</span>', ],
相关问答
更多在gridview yii2中设置宽度图像(Set width image in gridview yii2)
Yii2 - gridview中的搜索链接无效(Yii2 - Search link in the gridview not working)
yii2 gridview中的URL(URL in yii2 gridview)
未定义的变量:karik gridview中的gridColumns:yii2(Undefined variable: gridColumns in karik gridview:yii2)
如何使Yii2 GridView响应?(How to make a Yii2 GridView responsive?)
在Yii2 gridview中禁用分页(Disable pagination in Yii2 gridview)
在Gridview函数yii2中访问变量(Access variable in Gridview function yii2)
如何知道yii2 Gridview上的列名[重复](How to know the column name on yii2 Gridview [duplicate])
在gridview yii2中使用implode(Using implode in gridview yii2)
Yii2 GridView中的HTML(HTML in Yii2 GridView)
相关文章
更多redis 集群环境搭建-redis集群管理
jobtracker.info could only be replicated to 0 nodes, instead of 1 错误解决
Redis Cookbook
Hive新旧jar包冲突引起的错误java.lang.NoSuchFieldError: info
redis sentinel.conf详解-redis集群管理
redis主从从架构搭建-redis集群管理
redis sentinel(哨兵) 配置详解-redis集群管理
redis主从复制(读写分离)-redis集群管理
Redis概述
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!