Blame view

frontend/controllers/PackageController.php 943 Bytes
6fabfc65   Anastasia   - social links
1
2
3
4
5
6
7
8
9
10
11
  <?php
      /**
       * Created by PhpStorm.
       * User: stes
       * Date: 01.06.18
       * Time: 12:20
       */
      
      namespace frontend\controllers;
      
      use common\models\Package;
c9ec322b   Anastasia   - package index
12
      use yii\data\ActiveDataProvider;
6fabfc65   Anastasia   - social links
13
14
15
16
17
18
19
20
21
22
23
      use yii\web\Controller;
  
      class PackageController extends Controller
      {
          public function actionView($id){
              $package = Package::find()->with('language')->where(['id' => $id])->one();
              
              return $this->render('view', [
                 'package' => $package
              ]);
          }
c9ec322b   Anastasia   - package index
24
25
26
27
28
29
30
31
32
          
          public function actionIndex(){
              $dataProvider = new ActiveDataProvider([
                  'query' => Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort')
                                                     ]);
              return $this->render('index', [
                 'dataProvider' => $dataProvider
              ]);
          }
6fabfc65   Anastasia   - social links
33
      }