2008-10-22 11:20 Wednesday
我学习php已经有一段时间了,在学习的过程中总是能够看到高手们在文章中提到mvc,但是貌似大家都对这个东西没有形成一个统一的权威的说法,所以我对mvc究竟是个什么东西也比较的茫然.很凑巧的,zend官网上介绍zend framework的一篇文章中提到了mvc,作为php的强有力支持者,我想zend关于mvc的解释应该算是比较权威的吧.于是乎就放到我的博客上,让更多的初学php的人能够理解这个概念.
原文:
- Model- This is the part of your application that defines its basic functionality behind a set of abstractions. Data access routines and some business logic can be defined in the model.
- View- Views define exactly what is presented to the user. Usually controllers pass data to each view to render in some format. Views will often collect data from the user, as well. This is where you're likely to find HTML markup in your MVC applications.
- Controller- Controllers bind the whole pattern together. They manipulate models, decide which view to display based on the user's request and other factors, pass along the data that each view will need, or hand off control to another controller entirely. Most MVC experts recommend keeping controllers as skinny as possible.
译文:
- 模式-这是应用中的一个部分,它基于一系列抽象概念定义应用的基本功能.数据存取方式和一些业务逻辑可以在模式中定义.
- 视图-视图清楚的定义了把什么展示给用户.通常控制器传送数据到每一个视图,视图用一些格式对其进行解码.同样的,视图还会从用户那里收集数据.这也是你可以在mvc应用中找到Html标记的地方.
- 控制器-控制器将所有的部分组织起来.它操作模式,确定使用哪个视图对用户的请求以及其他的事件进行展示,传送数据到每一个需要它的视图去,或者把控制权整个的转交到另一个控制器.大多数的mvc专家建议要保持控制器的简洁.

标签: 编程 英语 php mvc zend 翻译
2008-9-17 10:54 Wednesday
鉴于这个博客程序的文本存储很差,我自行更改了数据库中文本存储的类型,改为了超长文本类型,应该可以存下很大的文章了吧.我接下来要翻译的这篇文章貌似有点儿太长了,光英文就有4页多,翻成汉语估计我就要疯掉了.
原文:
An Introduction to AJAX
In the first part of this series, we took a look at how PHP 5 can be used to manipulate and parse XML files. In this installment, we are going to focus on Ajax, one of the most useful and topical applications of XML.
Initially, we are going to introduce Ajax and learn how to use the XMLHTTP object provided by most modern web browsers to create a live email validation form. Then we will pick up where we left off with the theme of XML and introduce XSLT, which we will use to transform our library XML from the previous article into valid XHTML code.
What is AJAX?
There exists today a huge number of web applications that do everything from manage your photos, to mission-critical distributed systems. The majority of these applications exist in three parts.
The back end section is usually where the data pertinent to the application is stored. The back end may include logic which deals with the update and retrieval of this data in the form of server side code, SQL and stored procedures.
The middle ware section is where all the magic happens, typically transforming, manipulating, retrieving, verifying an validating the data before sending it on to the front end.
The front end section is what the user interacts with; it often contains very little logic and simply acts as an engine which initiates the communication with the middle end. Although the front end does not do much in terms of the application logic, it is probably the single most important part of the application. A poorly designed and awkward-to-use front end makes all the magic of the middle ware redundant.
标签: 编程 英语 php AJAX Javascript XML XSLT html xhtml
2008-9-7 14:35 Sunday
我简直要崩溃了,挑了个超难的题目来翻译,本来头就已经很大的说,结果翻译了一半自动保存就出了个大问题,导致已经翻译的文章都丢失了,难怪我的翻译老师说翻译不是人干的活.
废话不说了,只好从头开始翻译了,简要介绍一下我所要翻译的这个系列文章.文章涉及的是使用PHP操作XML的方面,其中有一些算是入门的内容,但是肯定也有一些会谈及高级编程,不管怎么说这篇文章貌似全中国还没有人翻译过,拿它来开刀实在是适合我这样不知道天高地厚的小子.
原文:
This series of articles will focus on XML, its applications in modern day web development and how PHP fits into this niche. In this article, we will focus specifically on the tools provided to us by PHP which enable us to manipulate XML data sources.
阅读全文>>
标签: 编程 英语 php AJAX Javascript XML DOM Xpath simple XML
2008-8-29 10:28 Friday
打算拿这篇别人已经翻译烂了的文章作为开篇,因为我觉得只有翻译的很优雅和符合中国人民的阅读习惯才算是真正的翻译,鉴于此,很有必要再翻译一次.在下一篇文章我会把文章翻译中的难点详解一下,古语所谓:知其然,还要知其所以然.翻译的目的不仅仅是为了翻译而已,英语学习是个大众的东西.
原文:
If you've ever created large scripts that require many variables (sometimes nearly 100), you know what it's like trying to keep track of what each variable contains and what it's used for. Trust me, I've been there. If we can store those variables inside other variables then the list of hundereds shrinks to less than 10. That's where arrays come in.
标签: 编程 英语 array php 数组
2008-8-26 12:56 Tuesday
谁都无法预料的四次手术让我先后找到了人生中最重要的三样珍宝:女朋友,英语,编程.很难说这究竟是怎样的宿命轮回,轮回中我想尽办法让这三件珍宝能够完整无缺.女朋友让我有了创造一片属于自己的天地的想法和决心,英语给了我能够调动天下兵马的半枚虎符,而后来出现的编程带来了另一半兵权的象征物.
现在,我又拥有了雅译,这是一个创意,关于英语,编程.目前的雅译无法和我心目中的相提并论,因为她还远远不够完善和强大.我正在用我的虎符创造心目中的雅译,她强大,既是一个互动的翻译社区,也是翻译的历练之所,同时让编程这样的尤物可以同时活在两种或者更多中非原生语言之中.
总而言之,雅译将在英语以及编程两个行业之中成为中流砥柱的.
标签: 编程 英语 雅译