Trying to get property of non-object in yii : <p>I'm using yii framework and I'm new in yii and can't understand the problem in this code, it is giving error in this code and I just attached the image of my code</p>

<p><a href="https://i.stack.imgur.com/ZTANB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZTANB.png" alt="image1"></a></p>

<p>and when I just try to <code>echo '&lt;pre&gt;';print_r($role);echo '&lt;/pre&gt;';</code> it just print code like this</p>

<p><a href="https://i.stack.imgur.com/Upc7A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Upc7A.png" alt="image2"></a></p>

<p>can't understand why this is giving error.</p>
