I have a confusion about the structure of MVC pattern.
In some places while searching on google I found that the model updates all those views which are subscribed to that model. How the model updates the view in MVC pattern?
Can anyone give me a simple and clear idea how this happen by giving an example?
Thanks
MVC comes in a variety of flavours. It sounds like you may have been reading about the supervising controller pattern in which the view observes on changes to the model.
I see from your past questions and answers you like php. I’m not sure how common the supervising presenter is in php (I’ve certainly never used it, but am interested to know if others do). It is common in .Net applications (eg winforms) where a model can be databound to a UI control. The view is notified of changes to the model by subscribing to model events.
Anyhow, because I thought this would be fun to try in php I put together an example: