phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftForm

Source Location: /classes/SwiftForm.php

Class SwiftForm

Class Overview

Creates an HTML Form using the properties and fields defined by the user.

Located in /classes/SwiftForm.php [line 41]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftForm   __construct()   Creates a new SwiftForm object.
boolean   addInputField()   Creates and adds a input field with the provided attributes to the SwiftForm.
boolean   addRadioGroupField()   Creates and adds a field with the provided group of radio buttons and attributes to the SwiftForm.
boolean   addSelectField()   Creates and adds a select field with the provided options and attributes to the SwiftForm.
boolean   addTextAreaField()   Creates and adds a textarea field with the provided attributes to the SwiftForm.
string   renderForm()   Outputs the SwiftForm HTML to the page.

[ Top ]
Methods
Constructor __construct  [line 66]

  SwiftForm __construct( [string $form_name = null], [string $form_id = null], [string $form_action = null], [string $form_method = 'get'], [string $form_enctype = null], [string $form_container_id = null], [boolean $form_ajax = false]  )

Creates a new SwiftForm object.

Parameters:
string   $form_name:  The HTML name attribute for the form. (Optional)
string   $form_id:  The HTML id attribute for the form. (Optional)
string   $form_action:  The HTML action attribute for the form. (Optional)
string   $form_method:  The HTML method attribute for the form. Default: get (Optional)
string   $form_enctype:  The HTML enctype attribute for the form. (Optional)
string   $form_container_id:  The ID of the HTML container for the form. (Optional)
boolean   $form_ajax:  True for AJAX form submit or False for regular submit. Default: false (Optional)

API Tags:
Return:  The new SwiftForm object
Access:  public


[ Top ]
addInputField  [line 101]

  boolean addInputField( [string $type = 'text'], [string $name = null], [string $id = null], [string $value = null], [String $label = null], [String $label_valign = "top"], [array $ajax_event = null]  )

Creates and adds a input field with the provided attributes to the SwiftForm.

Parameters:
string   $type:  The HTML input type. (Default: text)
string   $name:  The name attribute. (Optional)
string   $id:  The ID attribute. (Optional)
string   $value:  The value attribute. (Optional)
String   $label:  A label for the input field. (Optional)
String   $label_valign:  The vertical-align css style for the label. Default = top (Optional)
array   $ajax_event:  Specify the event for this input field to trigger the AJAX call for this SwiftForm. (Optional)

API Tags:
Return:  True on success. Otherwise False.
Access:  public


[ Top ]
addRadioGroupField  [line 175]

  boolean addRadioGroupField( [array $radio_array = null], [string $name = null], [string $id = null], [String $label = null], [String $label_valign = "top"], [Integer $checked_option = -1]  )

Creates and adds a field with the provided group of radio buttons and attributes to the SwiftForm.

Parameters:
array   $radio_array:  An array, where array key is the radio button value and array value is the radio button label.
string   $name:  The name attribute. (Optional)
string   $id:  The base ID. Will be appended by the count of radio buttons e.g. id_0, id_1, id_2 (Optional)
String   $label:  A label for the radio button field. (Optional)
String   $label_valign:  The vertical-align css style for the label. Default = top (Optional)
Integer   $checked_option:  The index of the $option_array to preset as checked. (Optional)

API Tags:
Return:  True on success. Otherwise False.
Access:  public


[ Top ]
addSelectField  [line 219]

  boolean addSelectField( [array $option_array = null], [string $name = null], [string $id = null], [String $label = null], [String $label_valign = "top"], [Integer $selected_option = -1]  )

Creates and adds a select field with the provided options and attributes to the SwiftForm.

Parameters:
array   $option_array:  An array, where array key is the option value and array value is the option label.
string   $name:  The name attribute. (Optional)
string   $id:  The ID attribute. (Optional)
String   $label:  A label for the select field. (Optional)
String   $label_valign:  The vertical-align css style for the label. Default = top (Optional)
Integer   $selected_option:  The index of the $option_array to preset as selected. (Optional)

API Tags:
Return:  True on success. Otherwise False.
Access:  public


[ Top ]
addTextAreaField  [line 139]

  boolean addTextAreaField( [string $name = null], [string $id = null], [string $value = null], [String $label = null], [String $label_valign = "top"]  )

Creates and adds a textarea field with the provided attributes to the SwiftForm.

Parameters:
string   $name:  The name attribute. (Optional)
string   $id:  The ID attribute. (Optional)
string   $value:  The value of the textarea. (Optional)
String   $label:  A label for the textarea field. (Optional)
String   $label_valign:  The vertical-align css style for the label. Default = top (Optional)

API Tags:
Return:  True on success. Otherwise False.
Access:  public


[ Top ]
renderForm  [line 253]

  string renderForm( [string $style = 'plain']  )

Outputs the SwiftForm HTML to the page.

Parameters:
string   $style:  The style type for displaying the SwiftForm (plain, list, table). Default: plain. (Optional)

API Tags:
Return:  The HTML source code for the SwiftForm.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:15 +0200 by phpDocumentor 1.4.4