Understanding and Using Zend Form Decorators

Introduction 介绍

Zend_Form utilizes the decorator pattern in order to render elements and forms. Unlike the classic » decorator pattern, in which you pass an object to a wrapping class, decorators in Zend_Form implement a » strategy pattern, and utilize the metadata contained in an element or form in order to create a representation of it

Zend Form使用装饰器模式来呈现表单和表单元素。和典型的装饰器模式不同的是,在你传递一个对象到一个包装类,Zend Form中的装饰器实现了策略模式,使用包含在元素或表单中的元数据来创建它们的表现。

Don't let the terminology scare you away, however; at heart, decorators in Zend_Form are not terribly difficult, and the mini-tutorials that follow should help you along the way. They will guide you through the basics of decoration, all the way to creating decorators for composite elements.

不要被这些专业术语吓跑。实际上,Zend Form中的控制器并不是非常难。下面的简明教程会对你有所帮助。它们会指导你从基本的装饰器开始一直到为混合元素创建装饰器。


Understanding and Using Zend Form Decorators