手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆

zend framdwork quick start

首页 > PHP Framework >

最近重操旧业,看起了zend framework,如今的1.9x与以前不一样了。所以,把ZF的quick start逐步翻译一下,权当复习和温故了。

原文地址:http://framework.zend.com/docs/quickstart/create-a-model-and-database-table

ZF & MVC Introduction

Zend Framework

Zend Framework is an open source, object oriented web application framework for PHP 5. ZF is often called a 'component library', because it has many loosely coupled components that you can use more or less independently. But Zend Framework also provides an advanced Model-View-Controller (MVC) implementation that can be used to establish a basic structure for your ZF applications. A full list of Zend Framework components along with short descriptions may be found in the components overview. This QuickStart will introduce you to some of ZF's most commonly used components, including Zend_Controller, Zend_Layout, Zend_Config, Zend_Db, Zend_Db_Table, Zend_Registry, along with a few view helpers.

Using these components, we will build a simple database-driven guest book application within minutes. The complete source code for this application is available in the following archives:

zend framework 介绍

ZF是一个开源且面向对象的,支持PHP5的WEB应用框架。ZF通常被叫做“组件库”,因为他拥有很多松耦合的组件,因此你可以在应用中或多或少的独立使用它们。但ZF更多的是为你的ZF应用提供了一个高级的MVC架构【??翻译不来了】所有的ZF组件列表,你可以从 组件预览 页进行查看。而这个QuickStart会给你的ZF最通常使用的组件进行介绍,如Zend_Controller,Zend_layout,Zend_Config,Zend_Db,Zend_Db_table,Zend_Registry,以及一些视图助手【这个应该是讲View的,但不知道怎么翻译好。现在终于明白那些翻译书的朋友们的痛苦之处了。明知道啥意思就是说不出口,还是词汇量少啊】

Model-View-Controller

So what exactly is this MVC pattern everyone keeps talking about, and why should you care? MVC is much more than just a three-letter acronym (TLA) that you can whip out anytime you want to sound smart; it has become something of a standard in the design of modern web applications. And for good reason. Most web application code falls under one of the following three categories: presentation, business logic, and data access. The MVC pattern models this separation of concerns well. The end result is that your presentation code can be consolidated in one part of your application with your business logic in another and your data access code in yet another. Many developers have found this well-defined separation indispensable for keeping their code organized, especially when more than one developer is working on the same application.

MVC

那么我们就来讲讲什么是MVC了以及你对于MVC来说,最关心的是什么。MVC虽然只是三个单词的开始每个字母组成的新词,然而他已经成为了网页程序的标准设计模式了。而且,有充分的理由证明,大多数的网络程序代码都被归于以下三种分类之一:表达方式【?】,商业逻辑 和数据访问层。MVC模式则能够使你们将关注点进行分离。最终你的表示代码只占你的商业逻辑的一小部分,同样数据访问层也是这样。大多数开发人员发觉这能够使得他们保持代码分离并且条理清晰,尤其是在同一项目中有多名开发人员时。

翻译的很迷惘。。。

其实上面的大意无非就是MVC结构使得程序员可以将更多的精力放在业务逻辑上,而不是将大量的精力浪费在表现层和数据访问上。

不过,虽然翻译的很乱,但我还是多少又理解了一点这方面的知识。MVC如今已经被很多人所接受,很多招聘上也都写着,熟悉MVC模式开发。其实,如果真正项目已经按着MVC模式开发的话,那么招聘进去的人,又有多少是同时对于这三个方面进行开发的呢?

Model - View - Controller,在ZF框架中也是很分离的。看框架的 application目录就很清楚了。除了module和config目录外,剩下的就是:controllers,models和views目录了。。由此可见,基本上也分得比较清楚了




本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"易栈网-膘叔", 保留原始链接, 此外还必须标注原文标题和链接.

Tags: zend

« 上一篇 | 下一篇 »

只显示10条记录相关文章

ZendFramewok介绍 (浏览: 33029, 评论: 0)
【笔记】UBUNTU下安装zendoptimizer (浏览: 29815, 评论: 2)
使用ZendFramework的时候打印SQL (浏览: 29687, 评论: 0)
來自風雪之隅的:深入理解PHP原理之foreach (浏览: 25873, 评论: 1)
Zend_Acl and MVC Integration Part I (Basic Use) (浏览: 24992, 评论: 0)
zf的paginator的疑问 (浏览: 23969, 评论: 0)
using zf and smarty (浏览: 23653, 评论: 0)
继续解决ZendStudio5菜单中部分是方框的问题 (浏览: 23413, 评论: 0)
ZF在ubuntu下的运行 (浏览: 23410, 评论: 0)
Zend Studio 7.2 Released (浏览: 22035, 评论: 3)

发表评论

评论内容 (必填):