title: yii2 rules not applying to non-db attributes?
body: <p>I would like to upload multiple files at once. I have </p>
  
  <p>a model:</p>
  
  <pre><code>class KakiKingModel extends ActiveRecord {
  
      public $uploadedFiles;
  
      public function rules() {
          return [
              [['uploadedFiles'], 'file', 'extensions' =&gt; 'txt', 'checkExtensionByMimeType' =&gt; false, 'skipOnEmpty' =&gt; true, 'maxFiles' =&gt; 2]];
      }
      ...
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>use yii\web\UploadedFile;
  ...
  public function actionUpload() {
      $model = new KakiKingModel;
      $t = new KakiKingModel;
  
      if (Yii::$app-&gt;request-&gt;isPost) {
          $files = UploadedFile::getInstances($model, 'uploadedFiles');
  
          $t = [];
          $i = 0;
          foreach ($files as $i =&gt; $file) {
              $t[$i] = new KakiKingModel;
              $t[$i]-&gt;contentUploadedFile = file($file-&gt;tempName);
              $t[$i]-&gt;assign(); // assign file content to model attributes
              $i++;
          }
  
          if (Model::validateMultiple($t)) {
              foreach ($t as $item) {
                  $item-&gt;save(false);
              }
              return $this-&gt;redirect(['index']);
          } else {
              return $this-&gt;render('upload', [
                          'model' =&gt; $model,
                          't' =&gt; $t,
              ]);
          }
      }
  
      return $this-&gt;render('upload', [
                  'model' =&gt; $model,
                  't' =&gt; $t,
      ]);
  }
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>$form = ActiveForm::begin([
      ....
      'options' =&gt; ['enctype' =&gt; 'multipart/form-data'],
      ...
          &lt;?= $form-&gt;field($model, 'uploadedFiles[]')-&gt;fileInput(['multiple' =&gt; true]) ?&gt;
  </code></pre>
  
  <p>and the problem is, it accepts any other type of files also! Why is that? What am I doing wrong? Thanks!
  UPDATE: I have changed my content a bit, so that you can better understand why I find it disturbing that it doesn't work. It should work IMHO. Can you please help me? Thank you!</p>