cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform/html-quickform addformrule.xml exportvalue.xml exportvalues.xml
getattributesstring.xml getuploadedfile.xml isuploadedfile.xml moveuploadedfile.xml
| From: | Alexey Borzov | Date: | Mon, 11 Aug 2003 15:50:01 +0000 |
| Subject: | cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform/html-quickform addformrule.xml exportvalue.xml exportvalues.xml getattributesstring.xml getuploadedfile.xml isuploadedfile.xml moveuploadedfile.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1264@lists.php.net to get a copy of this message | ||
avb Mon Aug 11 11:50:01 2003 EDT
Added files:
/peardoc/en/package/html/html-quickform/html-quickform
addformrule.xml
exportvalue.xml
exportvalues.xml
Modified files:
/peardoc/en/package/html html-quickform.xml
/peardoc/en/package/html/html-quickform/html-quickform
getattributesstring.xml
getuploadedfile.xml
isuploadedfile.xml
moveuploadedfile.xml
Log:
Updated docs for 3.1
Index: peardoc/en/package/html/html-quickform.xml diff -u peardoc/en/package/html/html-quickform.xml:1.6 peardoc/en/package/html/html-quickform.xml:1.7 --- peardoc/en/package/html/html-quickform.xml:1.6 Fri Jun 20 01:19:08 2003 +++ peardoc/en/package/html/html-quickform.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="package.html.html-quickform"> <title>HTML_QuickForm</title> <para> @@ -61,6 +61,8 @@ <title>Getting, setting and processing element values</title> &package.html.html-quickform.html-quickform.setconstants; &package.html.html-quickform.html-quickform.setdefaults; +&package.html.html-quickform.html-quickform.exportvalue; +&package.html.html-quickform.html-quickform.exportvalues; &package.html.html-quickform.html-quickform.getelementvalue; &package.html.html-quickform.html-quickform.getsubmitvalue; &package.html.html-quickform.html-quickform.getsubmitvalues; @@ -80,6 +82,7 @@ &package.html.html-quickform.intro-validation; &package.html.html-quickform.html-quickform.addrule; &package.html.html-quickform.html-quickform.addgrouprule; +&package.html.html-quickform.html-quickform.addformrule; &package.html.html-quickform.html-quickform.iselementrequired; &package.html.html-quickform.html-quickform.validate; &package.html.html-quickform.html-quickform.getelementerror; Index: peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.1 Thu May 29 15:26:55 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.getattributesstring"> <refnamediv> <refname>HTML_QuickForm::getAttributesString()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.getattributesstring.desc"> &title.desc; + ¬e.deprecated; <para>Returns the HTML attributes of the form as string.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.getattributesstring.throws"> Index: peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.2 peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.3 --- peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.2 Sat May 31 11:13:52 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.html.html-quickform.html-quickform.getuploadedfile"> <refnamediv> <refname>HTML_QuickForm::getUploadedFile()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.getuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Returns temporary filename of uploaded file</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.getuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.1 Fri May 30 15:14:31 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.isuploadedfile"> <refnamediv> <refname>HTML_QuickForm::isUploadedFile()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.isuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Checks if the element contains an uploaded file</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.isuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.1 Fri May 30 15:14:31 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.moveuploadedfile"> <refnamediv> <refname>HTML_QuickForm::moveUploadedFile()</refname> @@ -20,6 +20,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.moveuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Moves an uploaded file into the destination</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.moveuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/addformrule.xml +++ peardoc/en/package/html/html-quickform/html-quickform/addformrule.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.addformrule"> <refnamediv> <refname>HTML_QuickForm::addFormRule()</refname> <refpurpose>Adds a global validation rule</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm::addFormRule</function></funcdef> <paramdef>mixed <parameter>$rule</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.desc"> &title.desc; <para> This should be used when you want to add a rule involving several fields or if you want to use some completely custom validation for your form. The rule function/method should return &true; in case of successful validation and array('element name' => 'error') when there were errors. </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$rule</parameter> </term> <listitem> <para> A valid callback </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_INVALID_RULE</constant></entry> <entry>Callback function does not exist in HTML_QuickForm::addFormRule()</entry> <entry>Tried to pass a name of a non-existant function as a callback</entry> <entry>Check spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.example"> &title.example; <example> <title>Using <function>addFormRule</function></title> <programlisting role="php"> <![CDATA[ <?php require_once ('HTML/QuickForm.php'); $form = new HTML_QuickForm(); // the function checks whether the passwords are the same function cmpPass($fields) { if (strlen($fields['passwd1']) && strlen($fields['passwd2']) && $fields['passwd1'] != $fields['passwd2']) { return array('passwd1' => 'Passwords are not the same'); } return true; } $form->addElement('password', 'passwd1', 'Enter password'); $form->addElement('password', 'passwd2', 'Confirm password'); $form->addFormRule('cmpPass'); ?> ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/html/html-quickform/html-quickform/exportvalue.xml +++ peardoc/en/package/html/html-quickform/html-quickform/exportvalue.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.exportvalue"> <refnamediv> <refname>HTML_QuickForm::exportValue()</refname> <refpurpose>Returns the element's "safe" value</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>HTML_QuickForm::exportValue</function></funcdef> <paramdef>string <parameter>$element</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.desc"> &title.desc; <para>This method first tries to find a <link linkend="package.html.html-quickform.intro-validation.filters">cleaned-up</link> submitted value, it will return a value set by setValue()/<link linkend="package.html.html-quickform.html-quickform.setdefaults"><function>setDefaults</function></link>/<link linkend="package.html.html-quickform.html-quickform.setconstants"><function>setConstants</function></link> if submitted value does not exist for the given element.</para> <para>The value that couldn't have possibly been submitted (e.g.: an option that is not present in <select> element's option list) is not considered valid and is not returned.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$element</parameter> </term> <listitem> <para> Name of the element </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.return"> &title.returns; <para> <emphasis>return</emphasis> element value </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_NONEXIST_ELEMENT</constant></entry> <entry>Element '<parameter>$element</parameter>' does not exist in HTML_QuickForm::exportValue()</entry> <entry>Tried to get a value of a non-existant element</entry> <entry>Check the element's name spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/html/html-quickform/html-quickform/exportvalues.xml +++ peardoc/en/package/html/html-quickform/html-quickform/exportvalues.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.exportvalues"> <refnamediv> <refname>HTML_QuickForm::exportValues()</refname> <refpurpose>Returns "safe" elements' values</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>HTML_QuickForm::exportValues</function></funcdef> <paramdef>mixed <parameter> <optional>$elementList = null</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.desc"> &title.desc; <para>Returns the values for the form elements. First it tries to return <link linkend="package.html.html-quickform.intro-validation.filters">filtered</link> submitted values, if there were none then it takes the values set by <link linkend="package.html.html-quickform.html-quickform.setdefaults"><function>setDefaults</function></link> or <link linkend="package.html.html-quickform.html-quickform.setconstants"><function>setConstants</function></link>.</para> <para>Unlike <link linkend="package.html.html-quickform.html-quickform.getsubmitvalues"><function>getSubmitValues</function></link>, this will return only the values corresponding to the elements <link linkend="package.html.html-quickform.html-quickform.addelement">added to the form</link> and only the values that could actually be submitted: if we have 'Yes'/'No' radiobuttons 'Maybe' will not be considered a valid submit value.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$elementList</parameter> </term> <listitem> <para> Array/string of element names, whose values we want. If not set then return all elements. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.return"> &title.returns; <para> <emphasis>return</emphasis> An assoc array of elements' values </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_NONEXIST_ELEMENT</constant></entry> <entry>Element '<parameter>$element</parameter>' does not exist in HTML_QuickForm::exportValue()</entry> <entry>Tried to get a value of a non-existant element</entry> <entry>Check the element's name spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
Index: peardoc/en/package/html/html-quickform.xml diff -u peardoc/en/package/html/html-quickform.xml:1.6 peardoc/en/package/html/html-quickform.xml:1.7 --- peardoc/en/package/html/html-quickform.xml:1.6 Fri Jun 20 01:19:08 2003 +++ peardoc/en/package/html/html-quickform.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="package.html.html-quickform"> <title>HTML_QuickForm</title> <para> @@ -61,6 +61,8 @@ <title>Getting, setting and processing element values</title> &package.html.html-quickform.html-quickform.setconstants; &package.html.html-quickform.html-quickform.setdefaults; +&package.html.html-quickform.html-quickform.exportvalue; +&package.html.html-quickform.html-quickform.exportvalues; &package.html.html-quickform.html-quickform.getelementvalue; &package.html.html-quickform.html-quickform.getsubmitvalue; &package.html.html-quickform.html-quickform.getsubmitvalues; @@ -80,6 +82,7 @@ &package.html.html-quickform.intro-validation; &package.html.html-quickform.html-quickform.addrule; &package.html.html-quickform.html-quickform.addgrouprule; +&package.html.html-quickform.html-quickform.addformrule; &package.html.html-quickform.html-quickform.iselementrequired; &package.html.html-quickform.html-quickform.validate; &package.html.html-quickform.html-quickform.getelementerror; Index: peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml:1.1 Thu May 29 15:26:55 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/getattributesstring.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.getattributesstring"> <refnamediv> <refname>HTML_QuickForm::getAttributesString()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.getattributesstring.desc"> &title.desc; + ¬e.deprecated; <para>Returns the HTML attributes of the form as string.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.getattributesstring.throws"> Index: peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.2 peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.3 --- peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml:1.2 Sat May 31 11:13:52 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/getuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.html.html-quickform.html-quickform.getuploadedfile"> <refnamediv> <refname>HTML_QuickForm::getUploadedFile()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.getuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Returns temporary filename of uploaded file</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.getuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml:1.1 Fri May 30 15:14:31 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/isuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.isuploadedfile"> <refnamediv> <refname>HTML_QuickForm::isUploadedFile()</refname> @@ -18,6 +18,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.isuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Checks if the element contains an uploaded file</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.isuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml diff -u peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml:1.1 Fri May 30 15:14:31 2003 +++ peardoc/en/package/html/html-quickform/html-quickform/moveuploadedfile.xml Mon Aug 11 11:50:01 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform.moveuploadedfile"> <refnamediv> <refname>HTML_QuickForm::moveUploadedFile()</refname> @@ -20,6 +20,7 @@ <refsect1 id="package.html.html-quickform.html-quickform.moveuploadedfile.desc"> &title.desc; + ¬e.deprecated; <para>Moves an uploaded file into the destination</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.moveuploadedfile.param"> Index: peardoc/en/package/html/html-quickform/html-quickform/addformrule.xml +++ peardoc/en/package/html/html-quickform/html-quickform/addformrule.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.addformrule"> <refnamediv> <refname>HTML_QuickForm::addFormRule()</refname> <refpurpose>Adds a global validation rule</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm::addFormRule</function></funcdef> <paramdef>mixed <parameter>$rule</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.desc"> &title.desc; <para> This should be used when you want to add a rule involving several fields or if you want to use some completely custom validation for your form. The rule function/method should return &true; in case of successful validation and array('element name' => 'error') when there were errors. </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$rule</parameter> </term> <listitem> <para> A valid callback </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_INVALID_RULE</constant></entry> <entry>Callback function does not exist in HTML_QuickForm::addFormRule()</entry> <entry>Tried to pass a name of a non-existant function as a callback</entry> <entry>Check spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.addformrule.example"> &title.example; <example> <title>Using <function>addFormRule</function></title> <programlisting role="php"> <![CDATA[ <?php require_once ('HTML/QuickForm.php'); $form = new HTML_QuickForm(); // the function checks whether the passwords are the same function cmpPass($fields) { if (strlen($fields['passwd1']) && strlen($fields['passwd2']) && $fields['passwd1'] != $fields['passwd2']) { return array('passwd1' => 'Passwords are not the same'); } return true; } $form->addElement('password', 'passwd1', 'Enter password'); $form->addElement('password', 'passwd2', 'Confirm password'); $form->addFormRule('cmpPass'); ?> ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/html/html-quickform/html-quickform/exportvalue.xml +++ peardoc/en/package/html/html-quickform/html-quickform/exportvalue.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.exportvalue"> <refnamediv> <refname>HTML_QuickForm::exportValue()</refname> <refpurpose>Returns the element's "safe" value</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>HTML_QuickForm::exportValue</function></funcdef> <paramdef>string <parameter>$element</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.desc"> &title.desc; <para>This method first tries to find a <link linkend="package.html.html-quickform.intro-validation.filters">cleaned-up</link> submitted value, it will return a value set by setValue()/<link linkend="package.html.html-quickform.html-quickform.setdefaults"><function>setDefaults</function></link>/<link linkend="package.html.html-quickform.html-quickform.setconstants"><function>setConstants</function></link> if submitted value does not exist for the given element.</para> <para>The value that couldn't have possibly been submitted (e.g.: an option that is not present in <select> element's option list) is not considered valid and is not returned.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$element</parameter> </term> <listitem> <para> Name of the element </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.return"> &title.returns; <para> <emphasis>return</emphasis> element value </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_NONEXIST_ELEMENT</constant></entry> <entry>Element '<parameter>$element</parameter>' does not exist in HTML_QuickForm::exportValue()</entry> <entry>Tried to get a value of a non-existant element</entry> <entry>Check the element's name spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalue.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/html/html-quickform/html-quickform/exportvalues.xml +++ peardoc/en/package/html/html-quickform/html-quickform/exportvalues.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform.exportvalues"> <refnamediv> <refname>HTML_QuickForm::exportValues()</refname> <refpurpose>Returns "safe" elements' values</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTML/QuickForm.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>HTML_QuickForm::exportValues</function></funcdef> <paramdef>mixed <parameter> <optional>$elementList = null</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.desc"> &title.desc; <para>Returns the values for the form elements. First it tries to return <link linkend="package.html.html-quickform.intro-validation.filters">filtered</link> submitted values, if there were none then it takes the values set by <link linkend="package.html.html-quickform.html-quickform.setdefaults"><function>setDefaults</function></link> or <link linkend="package.html.html-quickform.html-quickform.setconstants"><function>setConstants</function></link>.</para> <para>Unlike <link linkend="package.html.html-quickform.html-quickform.getsubmitvalues"><function>getSubmitValues</function></link>, this will return only the values corresponding to the elements <link linkend="package.html.html-quickform.html-quickform.addelement">added to the form</link> and only the values that could actually be submitted: if we have 'Yes'/'No' radiobuttons 'Maybe' will not be considered a valid submit value.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$elementList</parameter> </term> <listitem> <para> Array/string of element names, whose values we want. If not set then return all elements. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.return"> &title.returns; <para> <emphasis>return</emphasis> An assoc array of elements' values </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.throws"> &title.throws; <para> <table> <title>&title.throws.errortable;</title> <tgroup cols="4"> <thead> <row> <entry>Error code</entry> <entry>Error message</entry> <entry>Reason</entry> <entry>Solution</entry> </row> </thead> <tbody> <row> <entry><constant>QUICKFORM_NONEXIST_ELEMENT</constant></entry> <entry>Element '<parameter>$element</parameter>' does not exist in HTML_QuickForm::exportValue()</entry> <entry>Tried to get a value of a non-existant element</entry> <entry>Check the element's name spelling</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform.exportvalues.note"> &title.note; <para> <emphasis>since</emphasis> 3.1 </para> ¬e.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->