title: criteria Active data provider in Yii 2
body: <p>I'm trying to display database for each user in descending date order using data provider this works for Yii 1 at controller : </p>
  
  <pre><code>         $DataProvider = new CActiveDataProvider('ModelName', array(
                  'criteria' =&gt; array(
                  'condition' =&gt; 'user_id=' . Yii::app()-&gt;user-&gt;id,
                  'order' =&gt; 'submitted_dt DESC',
              ),
              'pagination' =&gt; array(
                  'pageSize' =&gt; 20,
              ),
          ));
  </code></pre>
  
  <p>i try this in Yii 2 :</p>
  
  <pre><code>     $DataProvider = new ActiveDataProvider([
                  'query' =&gt; ModelName::find(),
                'criteria' =&gt; [
                  'condition' =&gt; 'user_id=' . Yii::$app-&gt;user-&gt;identity-&gt;id,
                  'order' =&gt; 'submitted_dt DESC',
                   ], 
              'pagination' =&gt; [
                  'pageSize' =&gt; 20,
              ],
          ]);
  
          // get posts in the current page
          $Model= $DataProvider-&gt;getModels();
  </code></pre>
  
  <p>Error i get is unknown property: <code>yii\data\ActiveDataProvider::criteria</code> .So what is the way to set this condition and order ? 
  All suggestions are welcomed </p>