一个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>', ],
相关问答
更多-
例如,您可以为单元定义类 [ 'attribute' => 'title', 'format' => 'image', 'value' => function($data) { return 'you_image.jpeg'; }, 'contentOptions' => ['class' => 'come-class'] ], 然后使用CSS设置图像宽度。 如果图像宽度可以不同,请使用html格式 [ 'attribute' => 'title', 'fo ...
-
将URL路由更改为 ['/device/index', 'DeviceSearch[batch]' => $data->batch] Change URL route to ['/device/index', 'DeviceSearch[batch]' => $data->batch]
-
yii2 gridview中的URL(URL in yii2 gridview)[2021-12-22]
使用'format' => 'raw'而不是'format' => 'url' 。 Use 'format' => 'raw' instead of 'format' => 'url'. -
未定义的变量:karik gridview中的gridColumns:yii2(Undefined variable: gridColumns in karik gridview:yii2)[2022-06-25]
如果手动分配列,则不需要var iwth列规范,因此请将其删除 = GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, //'columns' => $gridColumns, 'showPageSummary' => true, 'columns' => [ ['class' => 'k ... -
正如它在Bootstrap文档中所述 : 通过在.table-responsive包装任何.table来创建响应表 所以只需将你的小部件包装进去// GridView hereAs it states in Bootstrap documentation: Create responsive tables by wrapping any .table in .table-responsive So just wrap your ...
-
尝试将分页(在您的控制器中)设置为false,如下所示: $dataProvider = new ActiveDataProvider([ 'query' => SomeModelClass::find(), 'pagination' => false, ]); Try setting pagination (in your controller) to false, like this: $dataProvider = new ActiveDataProvider([ ...
-
为了解释, $totalDays在小部件中不可用,因为整个函数仅在呈现小部件时运行,不再声明$totalDays 。 正如@arogachev上面暗示的那样,您需要在模型中制作$totalDays ,然后才能访问它。 在你的模型中试试这个; public function getTotalDays(){ //Your logic here to generate totalDays return $totalDays; } 然后你可以在你的视图中使用它; [ 'attribute' => 'cl ...
-
正如你所说, $item超出了范围,并且如php doc中所述, 关于匿名函数 (不是特定于yii): 闭包还可以从父作用域继承变量。 必须将任何此类变量传递给use语言构造。 你应该简单地添加use ($item) : 'value' => function($model) use ($item) { return $model->{$item->name}; }, PS:这个问题应该关闭,因为它是重复的 As you said, $item is out of scope, and as s ...
-
尝试这个: [ 'value' => function($data){ $sum = array(); foreach ($data->orderInfo as $request){ $sum[] = $request->order_items_offer_name; } return implode(',',$sum); }], T ...
-
Yii2 GridView中的HTML(HTML in Yii2 GridView)[2022-03-06]
数据库输出可能编码两次,而不是 Testing <span class='test'>HTML</span> 它的 Testing <span class='test'>HTML</span> 尝试解码它两次,如: 'value' => function ($model) { return Html::decode(Html::decode($model-> ...