Prev | Current Page 31 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

This is known as business logic. This is the code that decides how to apply the shipping
cost to an e-commerce order or the code that knows that a user has a first name and a surname. It follows
therefore that retrieving and storing data to a database is within the model layer. In terms of the code, the Zend
Framework provides the Zend_Db_Table class which provides table level access to the database and allows for
easily manipulating the data used by the application.
2.1.2 The View
The view is the display logic of the application. For a web application, this is usually the HTML code that
makes up the web pages, but can include, say, XML that is used for an RSS feed. Also, if the website allows
for export in CSV format, the generation of the CSV would be part of the view. The view files themselves are
known as templates as they usually have some code that allows for the displaying of data created by the model.
It is also usual to move the more complex template related code into functions known as View Helpers, View
Helpers improve the re-usability of the view code. By default the Zend Framework??™s view class (Zend_View)
uses PHP within the template files, but another template engine such as Smarty or PHPTAL may be
substituted.
2.1.3 The Controller
The controller is the rest of the code that makes up the application.


Pages:
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
motoryzacja szkoła narciarska wyrejestrowanie samochodu legnica obciążniki Wczasy nad morzem