MVCæž¶æž„ ==================== Phalconæä¾›äº†é¢å‘对象的类,用以在应用程åºä¸å®žçŽ°æ¨¡åž‹ï¼Œè§†å›¾ï¼ŒæŽ§åˆ¶å™¨æž¶æž„ï¼ˆé€šå¸¸æˆ‘ä»¬ç§°ä¹‹ä¸º MVC_ 架构)。这ç§è®¾è®¡æ¨¡å¼è¢«å¹¿æ³›çš„应用到其他Webæ¡†æž¶ä»¥åŠæ¡Œé¢åº”用程åºä¸ã€‚ MVC的好处包括: * 分离业务逻辑与用户界é¢ä»¥åŠæ•°æ®åº“层 * 清晰的代ç ç»“æž„ï¼Œä½¿ä»£ç æ›´å®¹æ˜“维护 å¦‚æžœä½ å†³å®šä½¿ç”¨MVCæž¶æž„æ¥å¼€å‘ä½ çš„ç¨‹åºï¼Œé‚£ä¹ˆåº”用程åºçš„æ¯ä¸ªè¯·æ±‚éƒ½å°†é‡‡ç”¨ MVC_ æž¶æž„çš„æ–¹å¼æ¥ç®¡ç†ã€‚Phalcon是一个采用Cè¯è¨€å¼€å‘çš„phpæ¡†æž¶ï¼Œè¿™ç§æ¨¡å¼æ˜¯ä¸€ç§å¯ä»¥å¾ˆå¥½çš„æä¾›é«˜æ€§èƒ½çš„æ–¹æ³•。 模型 ------ A model represents the information (data) of the application and the rules to manipulate that data. Models are primarily used for managing the rules of interaction with a corresponding database table. In most cases, each table in your database will correspond to one model in your application. The bulk of your application's business logic will be concentrated in the models. :doc:`Learn more <models>` 视图 ----- Views represent the user interface of your application. Views are often HTML files with embedded PHP code that perform tasks related solely to the presentation of the data. Views handle the job of providing data to the web browser or other tool that is used to make requests from your application. :doc:`Learn more <views>` 控制器 ----------- The controllers provide the "flow" between models and views. Controllers are responsible for processing the incoming requests from the web browser, interrogating the models for data, and passing that data on to the views for presentation. :doc:`Learn more <controllers>` .. _MVC: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller