phpDocumentor SForm
Renderers
[ class tree: SForm ] [ index: SForm ] [ all elements ]

Class: SForm_Renderer_HTML

Source Location: /SForm.php

Class SForm_Renderer_HTML

Class Overview

Render the form to plain (X)HTML

Renders the form in a manner compatable with XHTML or HTML. You can use SForm_Element::setOption() with value 'SForm_Element::$options' to turn on or off the XML style tags.

This is not intended to be used in a production environment. It is intended to be simple, and to show off the features of SForm. Please find a different renderer that suits your needs, or create your own. Personally, I dump the results of SForm_Renderer_Array directly into php.net/manual/en/api.assign.php Smarty::assign(), but feel free to make your own renderer. Please email me if you do.

Remember: SForm does not enforce XHTML compliance. If you nest an input tag as a direct child of a form, it is not valid. You must wrap it in a fieldset first.

Located in /SForm.php [line 3047]

SForm_Renderer
   |
   --SForm_Renderer_HTML

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SForm_Renderer

SForm_Renderer::$currElms
SForm_Renderer::$errors
SForm_Renderer::$hidden
SForm_Renderer::$javascript
SForm_Renderer::$jsPostfix
SForm_Renderer::$jsPrefix
SForm_Renderer::$required
SForm_Renderer::$stack

Inherited From SForm_Renderer

SForm_Renderer::append()
Append the current element's value to the tree
SForm_Renderer::applyJavaScript()
Applies the rendered JavaScript to the given form
SForm_Renderer::fetch()
We need to retrieve the resulting data
SForm_Renderer::pop()
Move back down in the stack
SForm_Renderer::push()
Move up a level in the stack
SForm_Renderer::rendJavaScript()
Render the array of JavaScript into a script
SForm_Renderer::startForm()
Start rendering the form

[ Top ]
Property Summary
string   $buffer   The main body of the output string

[ Top ]
Method Summary
void   append()   Append the current element to the output string
string   fetch()   Finish the form
void   pop()   Exit the current contianer
void   push()   Enter an element container

[ Top ]
Properties
string   $buffer = '' [line 3058]

The main body of the output string

This is saved here in a buffer instead of being output to the browser because we cannot output the beginning '<form>' until we know if we are outputting JavaScript. We need to visit the elemements before we know if any of them are requesting JavaScript functionality.

API Tags:
Access:  protected


[ Top ]
Methods
append  [line 3070]

  void append( SForm_Element $elm  )

Append the current element to the output string

First we check for an error message. If there is an error message, display it. Then we get the main body of text for the element, which is the label and the element itself. Then we retrieve any hidden parts of the element and any JavaScript.

Parameters:
object The   $elm:  element being rendered

API Tags:
Access:  public


Redefinition of:
SForm_Renderer::append()
Append the current element's value to the tree

[ Top ]
fetch  [line 3188]

  string fetch( SForm $form  )

Finish the form

After the form is rendered, create the JavaScript, error alert, and dump any hidden elements.

Parameters:
object The   $form:  form to render

API Tags:
Return:  Finished render
Access:  public


Redefinition of:
SForm_Renderer::fetch()
We need to retrieve the resulting data

[ Top ]
pop  [line 3169]

  void pop( SForm_Container $cont  )

Exit the current contianer

We'll handle the form later.

Parameters:
object The   $cont:  element container

API Tags:
Access:  public
See:  SForm_Renderer_HTML::push()


Redefinition of:
SForm_Renderer::pop()
Move back down in the stack

[ Top ]
push  [line 3123]

  void push( SForm_Container $cont  )

Enter an element container

Note that this could be a fieldset or the form itself. We aren't going to render the form now, so we'll skip it. We're going to assume a fieldset tag layout.

Parameters:
object The   $cont:  element container

API Tags:
Access:  public


Redefinition of:
SForm_Renderer::push()
Move up a level in the stack

[ Top ]

Documentation generated on Mon, 09 Apr 2007 19:08:49 -0500 by phpDocumentor 1.3.0