Selecting specific column value with condition
<p>I want to get a specific column from User table in yii2 using active record below is my code</p>

<pre><code>$model = User::findOne(['id' =&gt; 1]);
</code></pre>

<p>this will return all  the column from the table with user id equal 1, but suppose i just want to get only username and email from this column how do i write the query with active record, i tried the below code but it wont work..`</p>

<pre><code>$model = User::find('username','email')-&gt;where('id'=1)
</code></pre>