diff --git a/docs/en/programmers/api-functions/api-connect.xml b/docs/en/programmers/api-functions/api-connect.xml new file mode 100644 index 00000000..586f045c --- /dev/null +++ b/docs/en/programmers/api-functions/api-connect.xml @@ -0,0 +1,57 @@ + + + + + connect + + + + + <methodsynopsis> + <type>void</type><methodname>connect</methodname> + <methodparam><type>object</type><parameter>smarty</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>connect</methodname> + <methodparam><type>object</type><parameter>smarty</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>reset</parameter></methodparam> + </methodsynopsis> + <para> + connect() is required on every invocation of SmartyValidate. Pass your + $smarty object as the parameter. This sets up SmartyValidate with $smarty + and auto-registers the default form. Passing the optional second param as + true, the default form registration will get reset. + </para> + <example> + <title>connect + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-disconnect.xml b/docs/en/programmers/api-functions/api-disconnect.xml new file mode 100644 index 00000000..81fc5ef8 --- /dev/null +++ b/docs/en/programmers/api-functions/api-disconnect.xml @@ -0,0 +1,49 @@ + + + + + disconnect + + + + + <methodsynopsis> + <type>void</type><methodname>disconnect</methodname> + </methodsynopsis> + <para> + This clears the SmartyValidate session data. Call this after you are + completely finished with SmartyValidate (ie. do NOT call between form + submissions.) + </para> + <example> + <title>disconnect + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-is-form-registered.xml b/docs/en/programmers/api-functions/api-is-form-registered.xml new file mode 100644 index 00000000..91107809 --- /dev/null +++ b/docs/en/programmers/api-functions/api-is-form-registered.xml @@ -0,0 +1,48 @@ + + + + + is_form_registered + + + + + <methodsynopsis> + <type>bool</type><methodname>is_form_registered</methodname> + <methodparam><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Test if a form has been registered for validation. + </para> + <example> + <title>is_form_registered + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-is-registered-criteria.xml b/docs/en/programmers/api-functions/api-is-registered-criteria.xml new file mode 100644 index 00000000..8437f7cc --- /dev/null +++ b/docs/en/programmers/api-functions/api-is-registered-criteria.xml @@ -0,0 +1,54 @@ + + + + + is_registered_criteria + + + + + <methodsynopsis> + <type>bool</type><methodname>is_registered_criteria</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>is_registered_criteria</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Tests to see if a criteria function has been registered. + </para> +¶meter.form; + <example> + <title>is_registered_criteria + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-is-registered-transfrom.xml b/docs/en/programmers/api-functions/api-is-registered-transfrom.xml new file mode 100644 index 00000000..08c30330 --- /dev/null +++ b/docs/en/programmers/api-functions/api-is-registered-transfrom.xml @@ -0,0 +1,54 @@ + + + + + is_registered_transform + + + + + <methodsynopsis> + <type>bool</type><methodname>is_registered_transform</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>is_registered_transform</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Tests to see if a transform function has been registered. + </para> +¶meter.form; + <example> + <title>is_registered_transform + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-is-valid.xml b/docs/en/programmers/api-functions/api-is-valid.xml new file mode 100644 index 00000000..b8062408 --- /dev/null +++ b/docs/en/programmers/api-functions/api-is-valid.xml @@ -0,0 +1,57 @@ + + + + + is_valid + + + + + <methodsynopsis> + <type>bool</type><methodname>is_valid</methodname> + <methodparam><type>bool</type><parameter>formvars</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>is_valid</methodname> + <methodparam><type>bool</type><parameter>formvars</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Tests if the current form is valid. You MUST supply the form variable array + to this function, typically $_POST. You can optionally pass a form name as + the second parameter. Call this after the form is submitted. + </para> +¶meter.form; + <example> + <title>is_valid + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-register-criteria.xml b/docs/en/programmers/api-functions/api-register-criteria.xml new file mode 100644 index 00000000..660d78d1 --- /dev/null +++ b/docs/en/programmers/api-functions/api-register-criteria.xml @@ -0,0 +1,68 @@ + + + + + register_object + + + + + <methodsynopsis> + <type>void</type><methodname>register_criteria</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>register_criteria</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Registers a function to use with "isCustom" criteria type. All functions + must be registered before they can be used. You can optinally pass a form + name in the case you are validating more than one form at a time. Static + method calls are also supported such as foo::bar. You can also register a + method of an object instance such as foo->bar, but you must first register + the object with SmartyValidate. See the <link linkend="api.register.object">register_object()</link> method. + </para> +¶meter.form; +<note> + <title>Technical Note + + The register_function() method has been deprecated, use register_criteria() instead. + + + + register_criteria + +test_password'); +?> +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-register-form.xml b/docs/en/programmers/api-functions/api-register-form.xml new file mode 100644 index 00000000..7847873f --- /dev/null +++ b/docs/en/programmers/api-functions/api-register-form.xml @@ -0,0 +1,51 @@ + + + + + register_form + + + + + <methodsynopsis> + <type>void</type><methodname>register_form</methodname> + <methodparam><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Register a form to be validated. Each form must be registered before it can + be validated. You do not have to register the 'default' form, that is done + automatically by SmartyValidate. If you register a form that is already + registered, it will be "reset", meaning you will lose previously stored data! + </para> + <example> + <title>register_form + + +]]> + + + + + diff --git a/docs/en/programmers/api-functions/api-register-object.xml b/docs/en/programmers/api-functions/api-register-object.xml index 7992df4a..e24d50d1 100644 --- a/docs/en/programmers/api-functions/api-register-object.xml +++ b/docs/en/programmers/api-functions/api-register-object.xml @@ -9,17 +9,25 @@ <methodsynopsis> <type>void</type><methodname>register_object</methodname> - <methodparam><type>string</type><parameter>object_name</parameter></methodparam> + <methodparam><type>string</type><parameter>obj_name</parameter></methodparam> <methodparam><type>object</type><parameter>object</parameter></methodparam> - <methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam> - <methodparam><type>boolean</type><parameter>format</parameter></methodparam> - <methodparam><type>array</type><parameter>block_methods</parameter></methodparam> </methodsynopsis> <para> - This is to register an object for use in the templates. See the - <link linkend="advanced.features.objects">object section</link> - of the manual for examples. + Register an object with SmartyValidate for use in isCustom criteria. + Typically do this right after issuing <link linkend="api.connect">connect()</link>. + See the <link linkend="api.register.criteria">register_criteria()</link> + method for more details. </para> + <example> + <title>register_object + + +]]> + + + + + register_transform + + + + + <methodsynopsis> + <type>void</type><methodname>register_transform</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>register_transform</methodname> + <methodparam><type>string</type><parameter>func_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> + </methodsynopsis> + <para> + Registers a function to use with "transform" parameter. All functions must + be registered before they can be used. You can optinally pass a form name + in the case you are validating more than one form at a time. By default, + 'trim' is already registered. + </para> +¶meter.form; + <example> + <title>register_transform + + +]]> + + + + +