/**
  * Lists all Bookmark models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new BookmarkSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 public function actionMyBookmarks()
 {
     if (Currency::find()->where(['>', 'date', time()])->orderBy(['date' => SORT_DESC])->asArray()->one() == null) {
         $currency = new Currency();
         if ($currency->exchangeRates()) {
             Yii::$app->session->setFlash('warning', 'Exchange rates might differ from actual ones');
         }
     }
     $disabled_subcat = 'disabled';
     $disabled_city = 'disabled';
     $catList = ArrayHelper::map(Category::find()->asArray()->all(), 'id', 'name');
     $regionList = ArrayHelper::map(Region::find()->asArray()->all(), 'id', 'name');
     $subcatList = [];
     $cityList = [];
     $searchModel = new BookmarkSearch();
     $dataProvider = $searchModel->getMyBookmarks();
     $advert = new Advert();
     return $this->render('my-bookmarks', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'catList' => $catList, 'subcatList' => $subcatList, 'regionList' => $regionList, 'cityList' => $cityList, 'disabled_subcat' => $disabled_subcat, 'disabled_city' => $disabled_city, 'advert' => $advert]);
 }
Beispiel #3
0
 public function actionMyBookmarks()
 {
     $searchModel = new BookmarkSearch();
     $dataProvider = $searchModel->getMyBookmarks();
     return $this->render('my-bookmarks', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }