title: How to set attribute labels when using dynamic model in yii2 framework?
body: <p>How to set attribute labels when using dynamic model in yii2 framework?</p>
  
  <p>Here is my code below:</p>
  
  <pre><code>$model = DynamicModel::validateData(compact('name','shipping'), [
          [['name','shipping'], 'required'],
      ]);
      if ($model-&gt;hasErrors()) {
          // validation fails
        //  }
      } else {
          //validation true
      }
  </code></pre>