he
- he 2014-09-29 已签到连续签到2天,获得了10个金钱
- he 2014-09-28 已签到连续签到1天,获得了5个金钱
- he 回答了问题 Yii2原生SQL+GridView分页问题
$count = Yii::$app->db->createCommand(' SELECT COUNT(*) FROM user WHERE status=:status ', [':status' => 1])->queryScalar(); $dataProvider = new SqlDataProvider([ 'sql' => 'SELECT * FROM user WHERE status=:status', 'params' => [':status' => 1], 'totalCount' => $count, 'sort' => [ 'attributes' => [ 'age', 'name' => [ 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC], 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC], 'default' => SORT_DESC, 'label' => 'Name', ], ], ], 'pagination' => [ 'pageSize' => 20, ], ]); // get the user records in the current page $models = $dataProvider->getModels();
- he 回答了问题 Yii2原生SQL+GridView分页问题
为了避免你误人子弟我只好出手了
- he 回答了问题 Yii2原生SQL+GridView分页问题
视图
// display pagination echo LinkPager::widget([ 'pagination' => $pages, ]);
- he 评论了教程 Yii 2.0 批量插入数据
$sql = $queryBuilder->batchInsert('user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ]);
- he 评论了教程 Yii 2.0 批量插入数据
这个批量插入只能叫多次插入
- he 回复了话题 yii的缓存删除机制是怎么样的?
不会,下次访问时刷新
url: 'http://www.yiichina.com/follow?id=28519', dataType: 'json', success: function(data) { if(data.action == 'create') { } else { $.ajax({ url: 'http://www.yiichina.com/follow?id=28519', }); } },
});
- he 回复了话题 十万火急clientscript没法用啊。。
Yii2.0还是这样注册么?不是控制器与视图分离了么?
url: 'http://www.yiichina.com/follow?id=28519', dataType: 'json', success: function(data) { if(data.action == 'create') { } else { $.ajax({ url: 'http://www.yiichina.com/follow?id=28519', }); } },
});