Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend\Form\Decorator\JsAutoValidator Component Proposal

Proposed Component Name Zend\Form\Decorator\JsAutoValidator
Developer Notes\Form\Decorator\JsAutoValidator
Proposers Ricardo Buquet
Zend Liaison TBD
Revision 1.0 - 1 March 2012: Initial Draft. (wiki revision: 13)

Table of Contents

1. Overview

Zend\Form\Decorator\JsAutoValidator is a unobtrusive JavaScript validator that takes into account every (javascript) possible validator rule, and writes down a json with all the information, making available all you need to know to make your own javascript validation.
It also has a built in javascript validator, which can be replaced by your own implementation.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Zend\Form\Decorator\JsAutoValidator will generate an agnostic json for element validation, filtering and error decoration. This will allow you to use the built in javascript validator or your own implementation with a simple adapter pattern.

  • This component will correctly read the elements validators, filters and error decorators to generate a json with any of these, if present: validator names, parameters, messages variables, messages, errors, filters, error decorators and break chain on failure.
  • This component will optionally read correctly the errors and formErrors decorators in the form and elements, and expose their desired tags.
  • This component will optionally read the filtering parameters for the elements and expose their filter names.
  • This component will allow the user to specify on which event validation should occur (submitting or clicking a submit button)

4. Dependencies on Other Framework Components

  • Zend_Form_Decorator_Abstract
  • Zend_View
  • Zend_View_Helper_HeadScript by default, could be changed by own implementation
  • Zend_View_Helper_InlineScript by default, could be changed by own implementation
  • Zend_Exception
  • Jquery (only the draft will be changed to native javascript)

5. Theory of Operation

The component is added to any Zend_Form

6. Milestones / Tasks

  • Milestone 1: [DONE] design notes will be published here
  • Milestone 2: [DONE] Working prototype checked attached to the proposal (I don't know how to publish into the incubator) supporting use cases #1, #2
  • Milestone 3: [DONE] Unit tests exist, covering 100% of the code.
  • Milestone 4: [DONE] Initial documentation exists.

7. Class Index

  • Zend_Form_Decorator_JsAutoValidation

8. Use Cases

UC-01 Assign decorator through ini file
UC-02 Or using a php file.

And in both UC something like this will be printed in json through the inlineScript view helper.

9. Class Skeletons

This is the class skeletons


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.