backend/controllers/CustomerController.php
/**
     * Lists all Customer models.
     * @return mixed
     */
Lists all Customer models.
@return mixed
Lists all Customer models . @return mixed
public function actionIndex()
    {
        $searchModel = new CustomerSearch();
        $query = Customer::find();
        $pages = new Pagination([
            'totalCount' => $query->count(),
            'pageSize' => 5,
        ]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => $pages,
        ]);
            $model = Customer::find()->all();
        return $this->render('index', [
            'model' => $model,
        ]);
    }
public function actionIndex ( ) { $ searchModel = new CustomerSearch ( ) ; $ query = Customer :: find ( ) ; $ pages = new Pagination ( [ 'totalCount' => $ query -> count ( ) , 'pageSize' => 5 , ] ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'pagination' => $ pages , ] ) ; $ model = Customer :: find ( ) -> all ( ) ; return $ this -> render ( 'index' , [ 'model' => $ model , ] ) ; }
Lists all Customer models.
Lists all Customer models .
// $dataProvider = $searchModel->search(Yii::$app->request->queryParams); // 'searchModel' => $searchModel, // 'dataProvider' => $dataProvider,