Commit 4584991bacad49735edf5b8f60f5f76278b6893c

Authored by Anastasia
1 parent 5abe2731

- basket

Showing 1 changed file with 20 additions and 0 deletions   Show diff stats
controllers/BasketController.php
... ... @@ -100,6 +100,26 @@
100 100 }
101 101 return $output;
102 102 }
  103 +
  104 + public function actionRenderBasket(): string
  105 + {
  106 +
  107 + \Yii::$app->getAssetManager()->bundles[ 'yii\web\JqueryAsset' ][ 'js' ] = [];
  108 + $output = '';
  109 + $basket = \Yii::$app->get('basket');
  110 + $data = $basket->getData();
  111 + $models = $basket->findModels(array_keys($data));
  112 + if (!empty($models)) {
  113 + $output = $this->renderPartial(
  114 + 'basket_table_new',
  115 + [
  116 + 'models' => $models,
  117 + 'basket' => $basket,
  118 + ]
  119 + );
  120 + }
  121 + return $output;
  122 + }
103 123  
104 124 /**
105 125 * @param Basket $basket
... ...