title: Paging and Filter in Yii2 Gridview
body: <p>I used the CRUD generator in Yii2 and it generated the following code for my <code>actionIndex</code> controller...</p>
  
  <pre class="lang-php prettyprint-override"><code>public function actionIndex()
  {
      $searchModel = new LeadSearch();
      $dataProvider = $searchModel-&gt;search(Yii::$app-&gt;request-&gt;queryParams);
  
      return $this-&gt;render('index', [
          'searchModel' =&gt; $searchModel,
          'dataProvider' =&gt; $dataProvider,
      ]);
  }
  </code></pre>
  
  <p>I am trying to do two things to this default code:</p>
  
  <p>1) Set the page size so that the gridview displaying it only shows 10 rows</p>
  
  <p>2) Modify the <code>$searchModel</code> such that it only returns records where the status column in the table matches certain multiple values (IN Operator)... or better yet, all records that don't match a given value.</p>
  
  <p>For #1, I see many examples to set the 'pagination' while using <code>ActiveDataProvider</code>, but none for <code>search()</code>. This code didn't work for me...</p>
  
  <pre class="lang-php prettyprint-override"><code>$dataProvider = $searchModel-&gt;search(
      Yii::$app-&gt;request-&gt;queryParams, ['pagination' =&gt; [ 'pageSize' =&gt; 10 ]]
  );
  </code></pre>
  
  <p>For #2, I know we can filter by declaring the new LeadSearch object as...</p>
  
  <pre class="lang-php prettyprint-override"><code>$searchModel = new LeadSearch([ 'status' =&gt; 'open' ]);
  </code></pre>
  
  <p>...but something like this doesn't work...</p>
  
  <pre class="lang-php prettyprint-override"><code>$searchModel = new LeadSearch([ 'status' =&gt; ['open', 'pending'] ]);
  </code></pre>