MVC: do models interact with the view?

I know that everything goes through the controller.

but I often read articles that say something like this:

  • user interacts with controller view
  • asks the model to change its state Model
  • notifies the view of when its state has changed.

I do not get a third. why is it said that the model notifies the view when it actually notifies the controller and the controller notifies the view?

+5
source share
4 answers

This is similar to a desktop system, not a stateless system such as a website.

, , , , .

<?php foreach( $usersTableGateway->getUsers() as $user ): ?>
<?php echo $user ?><br>
<?php endforeach; ?>

( ) .

+3

MVC - , . , Page Controller , Front Fontroller. MVC - Zend , , .

Observer "" ( ), , MVC - ..

+2

, MVC . , , , , , .

, , " , " , .

, MVC - , . , , ... , MVC. , , .

+1
source

This does not violate the principles of MVC so that your viewing is listened directly to your model (see here ). ASAIK is the only solid MVC rule - indeed, you have a thick, blind model that protects data and business logic and is not aware of other parts of the system. How distinctions are made between representations and controllers and their relationship with the model are less strictly defined.

+1
source

All Articles