b0f143c3
Yarik
first commit
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
namespace backend\controllers;
use common\modules\blog\models\Article;
use yii\base\Controller;
use yii\data\ActiveDataProvider;
class BlogController extends Controller
{
public $defaultAction = 'articles';
public function actionIndex()
{
echo 123;
}
public function actionArticles($category_id = NULL)
{
$dataProvider = new ActiveDataProvider([
'query' => Article::find(),
'pagination' => [
'pageSize' => 10
]
]);
return $this->render('articles', ['dataProvider' => $dataProvider]);
}
}
|