/** * @param string $slug * @return string * @throws NotFoundHttpException */ public function actionView($slug) { if (null === ($page = Shop::page($slug))) { throw new NotFoundHttpException(); } return $this->render("/page/view", ['page' => $page]); }
/** * @return string|\yii\web\Response */ public function actionProfile() { $model = User::findIdentity(\Yii::$app->user->identity->getId()); if ($model->load(\Yii::$app->request->post()) && $model->save()) { return $this->redirect(['details']); } return $this->render('profile', ['model' => $model, 'countries' => Shop::countries()]); }
/** * @param $slug * @return string * @throws NotFoundHttpException */ public function actionView($slug) { $newsItem = Shop::news_item($slug); if (!$newsItem) { throw new NotFoundHttpException(); } return $this->render('view', ['newsItem' => $newsItem]); }
/** * @param $slug * @return string * @throws NotFoundHttpException */ public function actionView($slug) { $category = Catalog::cat($slug); if (!$category) { throw new NotFoundHttpException(); } return $this->render('/category/view', ['category' => $category, 'page' => Shop::page('catalog')]); }
/** * @param \yii\web\UrlManager $manager * @param string $route * @param array $params * @return bool|string */ public function createUrl($manager, $route, $params) { if ($route === 'page/view') { $id_slug = null; if (isset($params['slug'])) { $id_slug = $params['slug']; } if (isset($params['id'])) { $id_slug = $params['id']; } $page = Shop::page($id_slug); if ($page) { return $page->model->slug; } } return false; }
/** * @return string */ public function actionAbout() { return $this->render('about', ['page' => Shop::page(Pages::ABOUT)]); }
?> </a> </h3> <p> <?php echo $newsItem->model->announce; ?> </p> </div> </div> <?php } ?> </div> <div align="right"> <?php echo Shop::pager(); ?> </div> <?php if (!$newsItems) { ?> <?php echo Html::tag('div', Yii::t('yii', 'No results found.'), ['class' => 'no-results bordered']); ?> <?php } ?> </div>
/** * @return string */ public function actionFail() { return $this->render('fail', ['page' => Shop::page(Pages::ORDER_FAILED)]); }
/** * @return string */ public function actionIndex() { $cart = Cart::get(); $cart->normalize(); return $this->render('index', ['page' => Shop::page(Pages::SHOPPING_CART), 'cart' => $cart]); }
/** * @return string */ public function actionIndex() { return $this->render('index', ['page' => Shop::page(Pages::WISH_LIST), 'wishList' => WishList::get()]); }
/** * @param $q * @return string */ public function actionSearch($q) { $products = Catalog::search(trim($q), ['sort' => ['attributes' => ['name', 'price', 'rating']]]); return $this->render('search', ['products' => $products, 'page' => Shop::page(Pages::SEARCH_RESULTS)]); }