title: Yii2 REST create with fields()
body: <p>Let's say that I had the following API set up:</p>
  
  <p>Controller:</p>
  
  <pre><code>&lt;?php
  namespace app\modules\v1\controllers;
  
  use yii;
  
  class ResourceController extends \yii\rest\ActiveController
  {
      public $modelClass = 'app\modules\v1\models\Resource';
  }
  </code></pre>
  
  <p>Model:
      
  
  <pre><code>use yii;
  
  class Resource extends \yii\db\ActiveRecord
  {
  
      public static function tableName()
      {
          return 'ResourceTable';
      }
  
      public function fields()
      {
          return [
              'id' =&gt; 'ResourceID',
              'title' =&gt; 'ResourceTitle',
          ];
      }
  }
  </code></pre>
  
  <p>where my table only has the two columns, <code>ResourceID</code> and <code>Title</code>.</p>
  
  <p>When I try a <code>GET</code> request on the API, it works fine and returns the list of resources (or single resource in the case of <code>resource/{id}</code>) with the aliased field names. But when I try to <code>POST</code> to create a resource, I want to use the aliased field names (e.g. <code>title</code> instead of <code>ResourceTitle</code>). The problem is that the default <code>CreateAction</code> supplied by Yii does <code>$model-&gt;load()</code>, which looks for the field names in the table. If I use the aliased names then it returns an error. If I use the table field names, it works fine.</p>
  
  <p>So my question is, is there a way to expose resource attributes to the end user where the field names (using the <code>fields()</code> function) are the same for reading and creating? If possible, I'd like to avoid writing my own CreateAction.</p>