$app ?

Hi all,

I am relatively new to the whole MVC / Yii world. I am trying to understand how Yii works and talks with itself and I am slowly having things click the more I do. I have still yet to understand what the $app represents. I have seen it used with users / session interactions as well as a few other things. If there a way someone can explain to me or point out where I can find a good explanation of that?

Take a look here




var_dump(\Yii::$app);



?

\Yii::$app holds an instance of \yii\base\Application.

In the context of a web application it’s an instance of \yii\web\Application.

In the context of a console application it’s an instance of \yii\console\Application.

In the context of unit tests …it’s difficult but you can figure it out with some effort.

WOW! Thank you guys for the quick reply. Next day my laptop died and I was without a workstation for the last week :P. I am going to take a look at the link provided and digest the info you provided Phtamas.