Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2009-11-06 13:13:37

tawfekov
Administrator
From: www
Registered: 2009-08-06
Posts: 25
Website

question about MVC relations

if you saw this diagram in Wikipedia about the MVC
http://en.wikipedia.org/wiki/Model%E2%8 … controller
you would see a relation between the view and the model
for me i hadn't remembered any Zend Framework component has done this relation
can any one explain to me how this relation is done
and example will be nice smile
note :to exclude the dashed relation its out of the question scope

Offline

#2 2009-11-06 13:29:54

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: question about MVC relations

Hey Tawfek, ZF doesn't do MVC is this manner, with the implicit lines working through an observer. However, when you do something like

[code=php]
$this->view->user = User::findByName("jon");
[/code]
and then in your view:
[code=php]
<?php echo $this->user->name; ?>
[/code]

you're still decoupling the view from the model. MVC came out of smalltalk / lisp as a way of maintaining integrity across 3 layers. In a desktop (or AJAX) app, MVC closer resembles this because every action doesn't result in a postback. The postback makes the whole MVC thing a little different on the web.

here's a great essay on MVC and it's development:
http://www.ctrl-shift-b.com/2007/08/int … cture.html

I also found this, that I think answers your question (Microsoft's MVC implementation is a reflection of Zend / Rails' MVC implementation):

http://stephenwalther.com/blog/archive/ … f-mvc.aspx

Offline

#3 2009-11-07 13:35:18

tawfekov
Administrator
From: www
Registered: 2009-08-06
Posts: 25
Website

Re: question about MVC relations

thanks Jon ,
the second article helped me alot

Offline

Board footer

Powered by FluxBB