[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-doc
Subject:    [PEAR-DOC] cvs: peardoc /en/package html.xml  /en/package/html html-form.xml  /en/package/html/html-
From:       "Martin Jansen" <mj () php ! net>
Date:       2003-07-22 7:15:33
[Download RAW message or body]

mj		Tue Jul 22 03:15:33 2003 EDT

  Added files:                 
    /peardoc/en/package/html	html-form.xml 
    /peardoc/en/package/html/html-form	examples.xml intro.xml 

  Modified files:              
    /peardoc/en/package	html.xml 
  Log:
  * Adding a first draft of documentation for HTML_Form
  
  
Index: peardoc/en/package/html.xml
diff -u peardoc/en/package/html.xml:1.7 peardoc/en/package/html.xml:1.8
--- peardoc/en/package/html.xml:1.7	Fri May 23 10:21:32 2003
+++ peardoc/en/package/html.xml	Tue Jul 22 03:15:32 2003
@@ -6,6 +6,7 @@
   Provides Packages for working and creating HTML
  </para>
  
+ &package.html.html-form;
  &package.html.html-quickform;
  &package.html.html-template-it;
  &package.html.html-table;

Index: peardoc/en/package/html/html-form.xml
+++ peardoc/en/package/html/html-form.xml
<!-- $Revision: 1.1 $ -->
<sect1 id="package.html.html-form">
 <title>HTML_Form</title>

 <para>
  This is a simple HTML form generator. It supports all the
  HTML form element types including file uploads, may return
  or print the form, just individual form elements or the full
  form in "table mode" with a fixed layout. 
 </para>


 &package.html.html-form.intro;
 &package.html.html-form.examples;
 </sect1>
<!-- 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-form/examples.xml
+++ peardoc/en/package/html/html-form/examples.xml
<!-- $Revision: 1.1 $ -->
<refentry id="package.html.html-form.examples">
 <refnamediv>
  <refname>Usage examples</refname>
  <refpurpose>Using HTML_Form.</refpurpose>
 </refnamediv>

 <refsect1 id="package.html.html-form.examples.tablemode">
  <title>Creating the form in <quote>table mode</quote></title>

  <para>
   Creating a form in <quote>table mode</quote> means that the
   package returns the complete form in a fixed width table. Whilst
   this does not work very well for most frontend websites, it is a
   very convenient way to create forms during development phase or
   for backend systems where the design does not matter (much).
  </para>

  <example>
   <title>Creating a form</title>

   <programlisting role="php">
<![CDATA[
require_once "HTML/Form.php";

$form = new HTML_Form($_SERVER['PHP_SELF']);

$form->addText("name", "What's your name?");
$form->addText("email", "What's your email address?");
$form->addPassword("password", "Please enter the desired password");
$form->addPlaintext("Tip", "Your password should be hard to guess");
$form->addSubmit("submit", "Submit");

$form->display();
]]>
   </programlisting>
  </example>

  <para>
   This will display a table where the left column holds the labels of
   the different fields. In the right column the different fields are
   placed.
  </para>

 </refsect1>


 <refsect1 id="package.html.html-form.examples.displaying">
  <title>Displaying single form tags</title>

  <para>
   Apart from retrieving the table as a whole, one can also use the
   <acronym>API</acronym> of <classname>HTML_Form</classname> to
   directly display single form tags.
  </para>

  <example>
   <title>Directly displaying form tags</title>

   <programlisting role="php">
<![CDATA[
require_once "HTML/Form.php";

$form = new HTML_Form($_SERVER['PHP_SELF']);

$form->displayText("name", "What's your name?");
]]>
   </programlisting>
  </example>

  <para>
   The above example will print the <acronym>HTML</acronym> markup
   being necessary to render a text input field. It will not print
   the surrounding <literal>&lt;form /&gt;</literal> tag or something
   else!
  </para>

 </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-form/intro.xml
+++ peardoc/en/package/html/html-form/intro.xml
<!-- $Revision: 1.1 $ -->
<refentry id="package.html.html-form.intro">
 <refnamediv>
  <refname>Introduction to <classname>HTML_Form</classname></refname>
  <refpurpose>Generating <acronym>HTML</acronym> forms.</refpurpose>
 </refnamediv>

 <refsect1 id="package.html.html-form.intro.whatis">
  <title>What is HTML_Form?</title>

  <para>
   This is a simple <acronym>HTML</acronym> form generator. It 
   supports all the <acronym>HTML</acronym> form element types
   including file uploads, may return or print the form, just
   individual form elements or the full form in <quote>table mode</quote>
   with a fixed layout. 
  </para>

  <refsect2 id="package.html.html-form.intro.whatis.example">
   <title>Simple usage example</title>

   <example>
    <title>Basic example</title>

    <programlisting role="php">
<![CDATA[
require_once "HTML/Form.php";

$form = new HTML_Form($_SERVER['PHP_SELF']);

$form->addText("name", "What's your name?");
$form->addSubmit("submit", "Go, Go");

$form->display();
]]>
    </programlisting>
   </example>
   <para>
    The above example code creates a <acronym>HTML</acronym> form
    that only contains a single textfield with the name
    <quote>name</quote> and with the label 
    <quote>What's your name</quote> and a submit button labeled
    <quote>Go, Go</quote>.
   </para>
  </refsect2>

  <refsect2>
   <title>Supported tags</title>

   <para>
    The following <acronym>HTML</acronym> form tags are supported by
    <classname>HTML_Form</classname>: textfields, password fields,
    checkboxes, textareas, submit buttons, reset buttons, select
    fields, radio buttons, image fields, hidden fields, file upload
    fields. Additionally one can add blank spaces and plain text to
    the form.
   </para>
  </refsect2>

 </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
-->  




-- 
PEAR Documentation List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic