title: Yii2.0 pagination issue second page not working
body: <p>How do I do a pagination? I have a search form and a search button which passes in a date range. The first page is working successfully, however when I click on the second page, it shows everything. How do I pass the date range into my pagination?</p>
  
  <p><strong>EDIT:</strong> 
  Below is my ReportSearch.php (model)</p>
  
  <pre><code>    $dataProvider = new ActiveDataProvider([
          'query' =&gt; $query,
          'pagination' =&gt; [
              'pageSize' =&gt; 5,
              //'params' =&gt; array('search' =&gt; 'true', 'from_dt'=&gt;$stockmovement_summary_from_sales_date, 'to_dt'=&gt; $stockmovement_summary_to_sales_date),
          ],
      ]);
  
      $dataProvider-&gt;setSort([
          'defaultOrder' =&gt; [
              'd_item.desc_e_tx' =&gt; SORT_ASC,
          ],
          'attributes' =&gt; [
              'd_item.desc_e_tx'
          ]
      ]);
  
      return $dataProvider;
  }
  </code></pre>
  
  <p>Below is my controller:</p>
  
  <pre><code>$searchModel = new ReportSearch();
              $dataProvider = $searchModel-&gt;searchStockMovementSummary($stockmovement_summary_from_sales_date, $stockmovement_summary_to_sales_date);
              return $this-&gt;render('stockmovementreportsummary', [
                          'search' =&gt; 'true',
                          'dataProvider' =&gt; $dataProvider,
                          'from_dt' =&gt; $stockmovement_summary_from_sales_date,
                          'to_dt' =&gt; $stockmovement_summary_to_sales_date,
                          'model' =&gt; $searchModel,
              ]);
  </code></pre>
  
  <p>Below is my index.php</p>
  
  <pre><code>$reports = $dataProvider-&gt;getModels();
      $i=1;
  
      echo "&lt;table class='table table-striped table-bordered'&gt;";
      echo "&lt;tr&gt;&lt;th&gt;#&lt;/th&gt;&lt;th&gt;Item&lt;/th&gt;&lt;th&gt;Total Summary Usage Qty&lt;/th&gt;&lt;th&gt;Current Stock On Hand&lt;/th&gt;&lt;th&gt;Measurement&lt;/th&gt;&lt;/tr&gt;";
      foreach ($reports as $report) {
          $item_key = $report['report_item_key'];
          $item_model = Item::find()-&gt;where(['item_key' =&gt;$item_key])-&gt;one();
          $item_e_desc_tx = $item_model-&gt;desc_e_tx;
          $item_c_desc_tx = $item_model-&gt;desc_c_tx;
          $item_qty_no = $item_model-&gt;qty_no;
          $item_measurement_tx = $item_model-&gt;measurement;
          echo "&lt;tr&gt;";
          echo "&lt;td&gt;" . $i++ . "&lt;/td&gt;";
          echo "&lt;td&gt;" . Html::a($item_key, array('stockmovementreportdetailbyitem', 'item_key' =&gt; $item_key, 'search' =&gt; 'true', 'from_dt' =&gt; $from_dt, 'to_dt'=&gt;$to_dt)) . "&lt;br&gt;" . $item_e_desc_tx . "&lt;br&gt;" . $item_c_desc_tx ."&lt;/td&gt;";
          echo "&lt;td&gt;" . $report['total_summary_usage_qty'] . "&lt;/td&gt;";
          echo "&lt;td&gt;" . $item_qty_no . "&lt;/td&gt;";
          echo "&lt;td&gt;" . $item_measurement_tx . "&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
      echo "&lt;/table&gt;";
      echo \yii\widgets\LinkPager::widget([
          'pagination'=&gt;$dataProvider-&gt;pagination,     
      ]);
  </code></pre>