title: Get model attribute's type in Yii2
body: <p>How can I check type (column type) of model's attribute  in Yii2?</p>
  
  <p><a href="http://www.yiiframework.com/forum/index.php/topic/34249-attribute-retrieved-as-string-instead-of-int/page__view__findpost__p__185266" rel="noreferrer">This old Yii Forum answer</a> gave me a conclusion, that in Yii1 I can use something like that:</p>
  
  <pre><code>$model-&gt;getMetaData()-&gt;columns['attribute-name']-&gt;type;
  </code></pre>
  
  <p>But I was unsuccessful in porting this solution to Yii2. Can someone help?</p>