Prev | Current Page 45 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"


With these four files in place, we have created a minimal Zend Framework application with all the pieces
in place ready for building a full scale website and you should now have a fundamental understanding of how
the pieces fit together. We will now look at what is happening within the Zend Framework??™s code which is
providing the MVC foundation that our code has been built upon.
2.6 How MVC Applies to the Zend Framework
Whilst there appears to be many different ways of routing web requests to code within web applications, they
can all be grouped into two camps: page controllers and front controllers. A page controller uses separate files
for every page (or group of pages) that make up the website and is traditionally how most PHP websites have
been built. This means that the control of the application is decentralized across lots of different files which
can result in repeated code, or worse, repeated and slightly altered code leading to issues such as lost sessions
when one of the files doesn??™t do a session_start().
A front controller, on the other hand, centralizes all web requests into a single file, typically called
index.php, which lives in the root directory of the website. There are numerous advantages to this system; the
most obvious are that there is less duplicated code and that it is easier to separate the URLs that a website has
from the actual code that is used to generate the pages.


Pages:
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
nieruchomości szczecin Działki szczecin hotele kompletacja zamówień ABBA