title: yii2 return ActiveRecord attribute as JSON with other name
body: <p>When I select ActiveRecord </p>
  
  <pre><code>$models = Model::find()
          -&gt;select(['someothername' =&gt; 'name'])-&gt;all();
  </code></pre>
  
  <p>and add this 'someothername' as public property to the model, I can then access it</p>
  
  <pre><code>$model-&gt;someothername
  </code></pre>
  
  <p>But now I need to return this field in JSON</p>
  
  <pre><code>\Yii::$app-&gt;response-&gt;format = \yii\web\Response::FORMAT_JSON;
  return $models;
  </code></pre>
  
  <p>How can I do it? Should I add 'someothername' to attributes?</p>