I'm new to MVC and Yii Framework. The $model variable seems very confusing to me.
Where is it declared in the fist place? Where does it come from?
When I work with GridView I see that some functions take $model as a parameter. Neither model nor model search of this GridView declares $model variable anywhere. Yet it is widely used in all sorts of data management. It just doesn't make sense to me.
So I need a simple, straight forward, "for dummies" explanation of $model variable in Yii Framework v2. Help in clarifying these questions is much appreciated: 1. What is the origin of $model variable? 2. How to identify what model of the app is the $model variable representing when it's used in view files? 3. There are sometimes multiple $model variables in a single view file. Do all of them represent one model class? How to distinguish them when used for multiple classes?
Thanks.