title: Yii2 formatter - create custom format
body: <p>I would like to create my own format option for DetailView and GridView. I'm now using available formatter options like datetime:</p>
  
  <pre><code>&lt;?= DetailView::widget([
          'model' =&gt; $model,
          'attributes' =&gt; [
              'current_date:datetime'
         ]
  ]?&gt;
  </code></pre>
  
  <p>I'd like to have my own formatter like this:</p>
  
  <pre><code> &lt;?= DetailView::widget([
              'model' =&gt; $model,
              'attributes' =&gt; [
                  'current_date:datetime',
                  'colorId:color'
             ]
      ]?&gt;
  </code></pre>
  
  <p>Where color would translate colorId (which is int - identifier of color) into color name. I know that I can have a function / virtual attribute in the model, but I would like to use it anywhere, not only on that certain model. I've been searching but found only that I need to have <a href="https://github.com/yiisoft/yii2/issues/6702" rel="nofollow noreferrer">specific formatter</a>.</p>