<?php
/**
 * Created by PhpStorm.
 * User: PHOENIX
 * Date: 26.04.16
 * Time: 17:51
 */

namespace common\modules\blog\controllers;


use common\components\AdminController;
use common\modules\blog\models\BlogSchedule;
use yii\data\ActiveDataProvider;

class BlogScheduleAdminController extends AdminController {

    public static function actionsTitles()
    {
        return [
            'Manage' => 'Расписание рассылок по блогу',
        ];
    }

    public function actionManage(){
        $dataProvider = new ActiveDataProvider([
            'query' => BlogSchedule::find(),
            'sort' => [
                'defaultOrder' => [
                    'date' => SORT_DESC
                ]
            ]
        ]);

        return $this->render(
            'manage',
            [
                'dataProvider' => $dataProvider
            ]
        );
    }
}