tailieunhanh - Getting Started with Zend Framework By Rob Allen

This tutorial is intended to give a very basic introduction to using Zend Framework to write a basic database driven application. NOTE: This tutorial has been tested on versions of Zend Framework. It stands a very good chance of working with later versions in the series, but will not work with versions prior to . | Getting Started with Zend Framework By Rob Allen WWW. akrabat. com Document Revision Copyright 2006 2008 This tutorial is intended to give a very basic introduction to using Zend Framework to write a basic database driven application. NOTE This tutorial has been tested on versions of Zend Framework. It stands a very good chance of working with later versions in the series but will not work with versions prior to . Model-View-Controller Architecture The traditional way to build a PHP application is to do something like the following php include include mysql_connect hostname username password mysql_select_db database php include h1 Home Page h1 php sql SELECT FROM news result mysql_query sql table php while row mysql_fetch_assoc result tr td php echo row date_created td td php echo row title td tr php table php include Over the lifetime of an application this type of application becomes un-maintainable as the client keeps requesting changes which are hacked into the code-base in various places. One method of improving the maintainability of the application is to separate out the code on the page into three distinct parts and usually separate files Model The model part of the application is the part that is concerned with the specifics of the data to be displayed. In the above example code it is the concept of news . Thus the model is generally concerned about the business logic part of the application and tends to load and save to databases. View The view consists of bits of the application that are concerned with the display to the user. Usually this is the HTML. Controller The controller ties together the specifics of the model and the view to ensure that the correct data is displayed on the page. Page 1 of 19 Zend Framework uses the Model-View-Controller MVC architecture. This is used to separate out the different parts of your application to make development and maintenance easier. Requirements

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG