title: Yii2 custom sql query in gridview
body: <p>I'm quite new to Yii2.
  I'm using advanced structure </p>
  
  <p>I need to show a custom sql result in a view without using a model because I would like to display a sql view.</p>
  
  <p>index.php</p>
  
  <pre><code>&lt;?= GridView::widget([
         'dataProvider' =&gt; $dataProvider,
         'columns' =&gt; [
              ['class' =&gt; 'yii\grid\SerialColumn'],
              'COD_RISORSA',
              [
                  'label' =&gt;"Nome",
                  'attribute' =&gt; 'NOME',
                  'value'=&gt;function($data){
                      return $data["NOME"];
                  }
              ],
              'COGNOME',
              ['class' =&gt; 'yii\grid\ActionColumn'],
          ],
     ]); ?&gt;
  </code></pre>
  
  <p>VRisorseController.php</p>
  
  <pre><code>public function actionIndex()
  {
  
      $totalCount = Yii::$app-&gt;db-&gt;createCommand('SELECT COUNT(*) FROM v_risorse')-&gt;queryScalar();
  
      $dataProvider = new SqlDataProvider([
          'sql' =&gt; 'SELECT * FROM v_risorse',
          'totalCount' =&gt; $totalCount,
          'sort' =&gt;false,
          'pagination' =&gt; [
              'pageSize' =&gt; 10,
          ],
      ]);
  
      return $this-&gt;render('index', [
          'dataProvider' =&gt; $dataProvider,
      ]);
  }
  </code></pre>
  
  <p>At the following Url:
  <a href="http://localhost/advanced/frontend/web/index.php?r=vrisorse%2Findex" rel="noreferrer">http://localhost/advanced/frontend/web/index.php?r=vrisorse%2Findex</a></p>
  
  <p>I have the error:</p>
  
  <blockquote>
    <p>Not Supported – yii\base\NotSupportedException Message format 'number'
    is only supported for integer values. You have to install PHP intl
    extension to use this feature.
    1. in C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\i18n\MessageFormatter.php</p>
  </blockquote>
  
  <p>I tried to comment all the columns in gridview, and the error seems to be related to <code>$dataProvider</code> variable</p>
  
  <p><code>'COD_RISORSA','NOME', 'COGNOME'</code> are columns of the select.</p>