root/trunk/examples/patExampleGen/sections_rule.php

Revision 295, 2.7 kB (checked in by schst, 3 years ago)

Added new removeRule() method (Fixes bug #174)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * Definitions for the examples on the patForms Rules
4  *
5  * $Id$
6  *
7  * @package        patForms
8  * @subpackage    Examples
9  * @author        Sebastian Mordziol <argh@php-tools.net>
10  */
11
12     $sections['Rule'] = array(
13         'descr'        =>    'These examples show the possibilities of form behavior
14                         and validation control of form and element rules. Rules
15                         allow you to create complex validations and to modify the
16                         form object depending on user input. A rule is an object
17                         that provides a method to apply the rule to the form or
18                         any element.',
19         'basename'    =>    'example_rule_',
20         'pages'        =>    array(
21             'before' => array(
22                 'title'    =>    'Applying a rule before form validation',
23                 'descr'    =>    'This example shows how to use rules to modify a form before the
24                             validation takes place - here, we use this to set the phone field
25                             as required when the user clicks the "call me" checkbox.',
26                 'tabs'  =>  array(
27                     'annotation' => array(
28                         'title' => 'Notes',
29                         'type'  => 'text',
30                         'text'  => 'Note that the validation errors added by rules are stored in the
31                                     special field __form, as those are really form-wide errors.',
32                     ),
33                 ),
34             ),
35             'after' => array(
36                 'title'    =>    'Applying a rule after from validation',
37                 'descr'    =>    'This example shows how to process form data after it as been validated -
38                             here, we use a rule to make sure the two password fields are identical. As
39                             this only makes sense after both fields are valid, this rule is applied
40                             after the validation.',
41                 'tabs'  =>  array(
42                     'annotation' => array(
43                         'title' => 'Notes',
44                         'type'  => 'text',
45                         'text'  => 'Note that the validation errors added by rules are stored in the
46                                     special field <b>__form</b>, as those are really form-wide errors.',
47                     ),
48                 ),
49             ),
50             'element' => array(
51                 'title'    =>    'Applying a rule to a single element',
52                 'descr'    =>    'Most commonly rules are used to check/create dependencies
53                             between several form elements, but can also be applied to
54                             a single element for custom validation features.'
55             ),
56             'conditionalenum' => array(
57                 'title'    =>    'The Conditional Enum rule',
58                 'descr'    =>    'Shows the conditional enum rule in action - this rule
59                             allows you to define which values are allowed in a field
60                             depending on the value of another.'
61             ),
62             'remove' => array(
63                 'title'    =>    'Removing a rule',
64                 'descr'    =>    'This example shows how to remove a rule. The unique id of the rule is used to identify it.'
65             ),
66             'format' => array(
67                 'title'    =>    'Using the format attribute',
68                 'descr'    =>    'The format attribute can be used to automatically add a rule. When setting the format more than once, the old rule will be removed automatically.'
69             ),
70         )
71     );
72 ?>
73
Note: See TracBrowser for help on using the browser.