Getting error "PHP Fatal Error – yii\base\ErrorException", "Class 'app\models\Yii' not found" while executing query in yii2
<p>I have just created on basic example for fetching of data from table using <a href="http://www.yiiframework.com/doc-2.0/guide-start-databases.html" rel="nofollow noreferrer">this</a> and it worked well, but now I want to write query using yii query builder </p>

<pre><code>($list= Yii::$app()-&gt;db-&gt;createCommand('select * from country')-&gt;queryAll();) 
</code></pre>

<p>but in this case I am getting error for</p>

<blockquote>
  <p>"PHP Fatal Error – yii\base\ErrorException", "Class 'app\models\Yii' not found". </p>
</blockquote>

<p><img src="https://i.stack.imgur.com/QiHJZ.png" alt="enter image description here"></p>