Tuesday, 10 February 2015

Yii2 Dataprovider Pagination Set Default Value


To set yii2 data provider default pagination, the code is
    
 $dataProvider = new ActiveDataProvider([
         'query' => $query,
         'pagination'=> ['defaultPageSize' => 50]

     ]) 


    ( or )


  $dataProvider->pagination = ['defaultPageSize' => 50];