NewsController.php
644 Bytes
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
30
31
32
33
34
35
36
37
38
39
<?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');
}
}