title: Yii2, Custom validation message with attribute names
body: <p>In Login form, I need to have <code>glyphicon-remove</code> icon at the end of every validation message with the corresponding field names. So I used below code in the <code>Login model</code>.</p>
  
  <pre><code>['email', 'required', 'message' =&gt; 'Email cannot be blank&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;'],
  ['password', 'required', 'message' =&gt; 'Password cannot be blank&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;']
  </code></pre>
  
  <p>Instead of this above code, Is there any possible way to use something like the below code.</p>
  
  <pre><code>[['email', 'password'], 'required', 'message' =&gt; $attribute.' cannot be blank&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;']
  </code></pre>
  
  <p>The idea of the above code is to get corresponding field name dynamically for every fields.</p>
  
  <p>Please do the needful. Thanks.</p>
  
  <p><strong>Update</strong></p>
  
  <p>The <code>HTML</code> code (<code>&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;</code>) here I've used is output correctly by using <code>encode=&gt;'false'</code>. But what I need is instead of defining separately for every fields, need to define commonly for all fields.</p>