Commit 1175ed37e160e32348d41afafbe71d0227f3685f
1 parent
5f2088c7
Добавлена миграция
Showing
3 changed files
with
20 additions
and
1 deletions
Show diff stats
common/modules/blog/controllers/ArticleController.php
1 | 1 | <?php |
2 | 2 | namespace common\modules\blog\controllers; |
3 | 3 | |
4 | +use common\modules\blog\models\Article; | |
5 | +use yii\data\ActiveDataProvider; | |
4 | 6 | use yii\web\Controller; |
5 | 7 | |
6 | 8 | class ArticleController extends Controller |
7 | 9 | { |
8 | - | |
10 | + public function actionIndex() | |
11 | + { | |
12 | + $dataProvider = new ActiveDataProvider([ | |
13 | + 'query' => Article::find(), | |
14 | + 'pagination' => [ | |
15 | + 'pageSize' => 1, | |
16 | + ], | |
17 | + ]); | |
18 | + return $this->render('index', ['dataProvider' => $dataProvider]); | |
19 | + } | |
9 | 20 | } | ... | ... |
No preview for this file type