public function actionIndex()
    {
        $searchModel = new SearchProduct();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        $notModeratedProductsCount = Product::find()->where(['status' => Product::STATUS_ON_MODERATION])->count();

        return $this->render('index', [
            'notModeratedProductsCount' => $notModeratedProductsCount,
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'languages' => Language::findAll(['active' => true])
        ]);

    }
public function actionIndex()
    {
        $searchModel = new SearchProduct();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        $notModeratedProductsCount = Product::find()->where(['status' => Product::STATUS_ON_MODERATION])->count();

        return $this->render('index', [
            'notModeratedProductsCount' => $notModeratedProductsCount,
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'languages' => Language::findAll(['active' => true])
        ]);

    }
public function actionIndex ( ) { $ searchModel = new SearchProduct ( ) ; $ dataProvider = $ searchModel -> search ( Yii :: $ app -> request -> queryParams ) ; $ notModeratedProductsCount = Product :: find ( ) -> where ( [ 'status' => Product :: STATUS_ON_MODERATION ] ) -> count ( ) ; return $ this -> render ( 'index' , [ 'notModeratedProductsCount' => $ notModeratedProductsCount , 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , 'languages' => Language :: findAll ( [ 'active' => true ] ) ] ) ; }
Displays products list.

DataProvider sends created by user product models for users which have 'viewProductList' permission
and for users which have 'viewCompleteProductList' permission it sends all product models.

@return mixed
@throws ForbiddenHttpException
Displays products list .