title: How to add custom class to label in Yii2 form field?
body: <p>I want to add a custom class to label tag in this code in Yii2, but I don't know how.</p>
  <pre><code>&lt;?= $form-&gt;field($model, 'name',[
                      'template' =&gt; &quot;{label}\n&lt;div class='col-md-6'&gt;{input}&lt;/div&gt;\n{hint}\n{error}&quot;])-&gt;textInput(['maxlength' =&gt; true])?&gt;
  </code></pre>