NewsController.php 644 Bytes
<?php
namespace frontend\controllers;


use Yii;
use common\models\News;
use yii\data\ActiveDataProvider;
use yii\web\Controller;


/**
 * Site controller
 */
class NewsController extends Controller
{
    public $layout = '/internal';

    public function actionIndex()
    {
        $dataProvider = new ActiveDataProvider([
            'query' => News::find(),
            'pagination' => [
                'pageSize' => 16,
            ],

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

    public function actionView()
    {

        return $this->render('view');
    }


}