<?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]);
    }

}