mapwa
既然没有action项目,你为什么要放呢,放了还要它不显示,这不是为难它呢.
- mapwa 2017-08-16 已签到连续签到1天,获得了5个金钱
- mapwa 评论了源码 yii2的分页 适合初学者 最基本详细
* Controller action: *
- public function actionIndex()
- {
- $query = Article::find()->where(['status' => 1]);
- $countQuery = clone $query;
- $pages = new Pagination(['totalCount' => $countQuery->count()]);
- $models = $query->offset($pages->offset)
- ->limit($pages->limit)
- ->all();
* - return $this->render('index', [
- 'models' => $models,
- 'pages' => $pages,
- ]);
- }
*
- View:
* - foreach ($models as $model) {
- // display $model here
- }
* - // display pagination
- echo LinkPager::widget([
- 'pagination' => $pages,
- ]);
这个官方的注释,比你这个清晰一点.
- mapwa 评论了源码 Yii2 开源商城 FecShop
安装环境太复杂了. 为啥又要mango 又要redis呢.
写的不错.赞一个
- mapwa 回复了话题 下面这种route用法啥意思?
这似乎不是yii的路由吧,
- mapwa 2016-11-01 已签到连续签到1天,获得了5个金钱
- mapwa 评论了源码 Yii2通用后台,肯定很熟悉
提供源码学习下啊