PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Creating Form Elements Using Zend_Form_Element

A form is made of elements that typically correspond to HTML form input. Zend_Form_Element encapsulates single form elements, with the following areas of responsibility:

  • validation (is submitted data valid?)

    • capturing of validation error codes and messages

  • filtering (how is the element escaped or normalized prior to validation and/or for output?)

  • rendering (how is the element displayed?)

  • metadata and attributes (what information further qualifies the element?)

The base class, Zend_Form_Element, has reasonable defaults for many cases, but it is best to extend the class for commonly used special purpose elements. Additionally, Zend Framework ships with a number of standard XHTML elements; you can read about them in the Standard Elements chapter.

Zend Framework