2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
5 * An abstract base class for QuickForm renderers
9 * LICENSE: This source file is subject to version 3.01 of the PHP license
10 * that is available through the world-wide-web at the following URI:
11 * http://www.php.net/license/3_01.txt If you did not receive a copy of
12 * the PHP License and are unable to obtain it through the web, please
13 * send a note to license@php.net so we can mail you a copy immediately.
16 * @package HTML_QuickForm
17 * @author Alexey Borzov <avb@php.net>
18 * @copyright 2001-2011 The PHP Group
19 * @license http://www.php.net/license/3_01.txt PHP License 3.01
21 * @link http://pear.php.net/package/HTML_QuickForm
25 * An abstract base class for QuickForm renderers
27 * The class implements a Visitor design pattern
30 * @package HTML_QuickForm
31 * @author Alexey Borzov <avb@php.net>
32 * @version Release: 3.2.16
36 class HTML_QuickForm_Renderer
43 function HTML_QuickForm_Renderer()
48 * Called when visiting a form, before processing any form elements
50 * @param HTML_QuickForm a form being visited
55 function startForm(&$form)
58 } // end func startForm
61 * Called when visiting a form, after processing all form elements
63 * @param HTML_QuickForm a form being visited
68 function finishForm(&$form)
71 } // end func finishForm
74 * Called when visiting a header element
76 * @param HTML_QuickForm_header a header element being visited
81 function renderHeader(&$header)
84 } // end func renderHeader
87 * Called when visiting an element
89 * @param HTML_QuickForm_element form element being visited
90 * @param bool Whether an element is required
91 * @param string An error message associated with an element
96 function renderElement(&$element, $required, $error)
99 } // end func renderElement
102 * Called when visiting a hidden element
104 * @param HTML_QuickForm_element a hidden element being visited
109 function renderHidden(&$element)
112 } // end func renderHidden
115 * Called when visiting a raw HTML/text pseudo-element
117 * Only implemented in Default renderer. Usage of 'html' elements is
118 * discouraged, templates should be used instead.
120 * @param HTML_QuickForm_html a 'raw html' element being visited
125 function renderHtml(&$data)
128 } // end func renderHtml
131 * Called when visiting a group, before processing any group elements
133 * @param HTML_QuickForm_group A group being visited
134 * @param bool Whether a group is required
135 * @param string An error message associated with a group
140 function startGroup(&$group, $required, $error)
143 } // end func startGroup
146 * Called when visiting a group, after processing all group elements
148 * @param HTML_QuickForm_group A group being visited
153 function finishGroup(&$group)
156 } // end func finishGroup
157 } // end class HTML_QuickForm_Renderer