depth < 2) { return $this->render( 'categories', [ 'category' => $category ] ); } else { return $this->render( 'products', [ 'category' => $category, ] ); } } public function actionProduct($alias) { $product = Product::find()->where('like', ['alias' => $alias]); if (empty($product->product_id)) { // throw new HttpException(404 ,'Page not found'); // return $this->redirect('/', 301); } return $this->render('product'); } public function actionBrands() { return 'actionBrands'; } public function actionBrand($alias) { return 'actionBrand:'. $alias; } }