Structures_Form
[ class tree: Structures_Form ] [ index: Structures_Form ] [ all elements ]

Source for file RendererInterface.php

Documentation is available at RendererInterface.php

  1. <?php
  2. /**
  3.  * An interface to enforce consistency among all group elements used in a
  4.  * Structures_Form.
  5.  *
  6.  * In HTML_QuickForm, all form renderers can extend one base class. In PHP-GTK
  7.  * 2 this is not possible. To maintain consistency, all renderers must
  8.  * implement this interface.
  9.  *
  10.  * This interface defines methods needed to collect and display form
  11.  * information including errors.
  12.  *
  13.  * A note contributors: I welcome contributions from others but I will not
  14.  * include any classes in the package that are not accompanied by a complete
  15.  * set of PHPUnit2 unit tests. Also, I am a stickler for documentation. Please
  16.  * make sure that your contributions are fully documented. Docblocks are not
  17.  * enough. There must be inline documentation. Please see Structures/Form.php
  18.  * for an example of what I mean by fully documented.
  19.  *
  20.  * @author    Scott Mattocks
  21.  * @package   Structures_Form
  22.  * @license   PHP License
  23.  * @version   0.8.0devel
  24.  * @copyright Copyright 2006 Scott Mattocks
  25.  */
  26.  
  27.     /**
  28.      * Sets the form.
  29.      *
  30.      * @access public
  31.      * @param  object $form The form.
  32.      * @return void 
  33.      */
  34.     public function setForm(Structures_Form $form);
  35.  
  36.     /**
  37.      * Sets the elements that make up the form.
  38.      *
  39.      * The array passed in will be of the form: array(<name> => <element>)
  40.      *
  41.      * @access public
  42.      * @param  array  $elements The elements that make up the form.
  43.      * @return void 
  44.      */
  45.     public function setElements($elements);
  46.  
  47.     /**
  48.      * Sets the errors to be displayed.
  49.      *
  50.      * @access public
  51.      * @param  array  $errors An array of error strings.
  52.      * @return void 
  53.      */
  54.     public function setErrors($errors);
  55.  
  56.     /**
  57.      * Returns the rendered form.
  58.      *
  59.      * This method should return something inline with the intent of the
  60.      * renderer even if there are no elements in the form. For example, if the
  61.      * renderer is a GtkTable renderer, this method should return a GtkTable
  62.      * no matter what. Of course, it may throw an exception if needed but
  63.      * should not return anything other than a GtkTable. Not even null or void.
  64.      *
  65.      * @access public
  66.      * @return mixed  The rendered form.
  67.      */
  68.     public function render();
  69.  
  70.     /**
  71.      * Sets the string to be used as the note indicating what the required
  72.      * symbol means.
  73.      *
  74.      * The required note does not include the required symbol. It is up to the
  75.      * renderer to append or prepend the required symbol in a way that makes
  76.      * sense for the rendered output.
  77.      *
  78.      * The required note is controlled by the form to maintain consistency when
  79.      * a single form is rendered in different ways.
  80.      * 
  81.      * @access public
  82.      * @param  string $note The required note.
  83.      * @return void 
  84.      */
  85.     public function setRequiredNote($note);
  86.  
  87.     /**
  88.      * Sets the string to be used as the note indicating what the required
  89.      * symbol means.
  90.      *
  91.      * The required note does not include the required symbol. It is up to the
  92.      * renderer to append or prepend the required symbol in a way that makes
  93.      * sense for the rendered output.
  94.      *
  95.      * The required symbol is controlled by the form to maintain consistency
  96.      * when a single form is rendered in different ways.
  97.      * 
  98.      * @access public
  99.      * @param  string $symbol The required symbol.
  100.      * @return void 
  101.      */
  102.     public function setRequiredSymbol($symbol);
  103.  
  104. }
  105. ?>

Documentation generated on Mon, 11 Mar 2019 14:44:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.