Exemple #1
0
 public function actionLanding()
 {
     $packages = Package::find()->where(['enable' => 1])->limit(4)->orderBy('position')->all();
     $toppups = Topup::find()->where(['enable' => 1])->limit(4)->orderBy('position')->all();
     $this->layout = 'unify/front_page';
     $temp = new HybrizyCartForm();
     $session = Yii::$app->user->isGuest ? $temp->loadSession('Hybrizy') : $temp->loadFromTable();
     if ($session == false) {
         $cart = ['totalCount' => 0];
     } else {
         $cart = $session;
     }
     return $this->render('landing', ['packages' => $packages, 'toppups' => $toppups, 'cart' => $cart]);
 }