Blame view

frontend/controllers/PackageController.php 859 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
          
          public function actionIndex(){
df88ecc9   Anastasia   - index package
26
27
28
              
              $packages =  Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort')->all();
              
c9ec322b   Anastasia   - package index
29
              return $this->render('index', [
df88ecc9   Anastasia   - index package
30
                 'packages' => $packages
c9ec322b   Anastasia   - package index
31
32
              ]);
          }
6fabfc65   Anastasia   - social links
33
      }