title: How i do custom Yii2 gridview sort?
body: <p>How can I sort with a customized <code>gridview</code> header?</p>
  
  <p>Please give the difference between <code>label</code> and <code>header</code> in the <code>Yii2</code> <code>gridview</code> widget <code>dataprovider</code>.</p>
  
  <p>Here is my code:</p>
  
  <pre class="lang-php prettyprint-override"><code>    &lt;?= GridView::widget([
              'dataProvider' =&gt; $dataProvider,
              'columns' =&gt; [
                   [
                     'class' =&gt; 'yii\grid\DataColumn',
                     'value' =&gt; function ($data) {
                      return $data-&gt;myTitle; 
                      },
                     'headerOptions' =&gt; ['style'=&gt;'text-align:center'],
                     'header' =&gt; 'Page Title',
                     'label' =&gt; 'Title'
                  ],
     ]); ?&gt;
  </code></pre>
  
  <p>Do <code>header</code> and <code>label</code> perform the same function?</p>
  
  <p>How can I perform sorting in <code>$data-&gt;myTitle</code>?</p>
  
  <p>Here my Output Screen:</p>
  
  <p><img src="https://i.stack.imgur.com/kRN5f.png" alt="enter image description here"></p>
  
  <p>I want Page Title, Status, Date Modified should be active.</p>
  
  <p>Thanks in advance.</p>