Helper class for managing QuickForm rules

package midcom.helper.datamanager2

 Methods

__construct (\HTML_QuickForm $form, \midcom_services_i18n_l10n $l10n)

Parameters

$form

$l10n

add_type_rules (\midcom_helper_datamanager2_type $type, array $config)

This helper function adds all rules which are deducible from the schema to the form.

It recognizes the following schema options:

  • required: Adds a required rule to the form, bound to the given element.

Parameters

$type

\midcom_helper_datamanager2_type

$config

array

add_validation_rules (array $rules)

Add form-wide validation rules

Parameters

$rules

arrayThe schema to use

load_type_rules ($type)

Parameters

$type

 Properties

 

mixed $_available

 

\HTML_QuickForm $_form

The form we're working on
 

\midcom_services_i18n_l10n $_l10n

L10n DB
 

array $_loaded

Tracks which rules have already been registered