Orion PHP  0.11.12
The PHP5.3 framework
Orion\Core\Form Class Reference

List of all members.

Public Member Functions

 __construct ($_name, $_action='#')
add ($field, $value=null)
addBefore ($element, $field, $value=null)
addField ($fieldname, $value=null)
remove ($fieldname)
 hydrate ($object)
 prepare ($model=null)
 toHtml ($XHTML=false)
 setModel ($_model)
 getModel ()
getField ($name)
 isMultipart ()

Public Attributes

const HIDDEN = 0
const TEXT = 1
const PASSWORD = 2
const TEXTAREA = 3
const CHECKBOX = 4
const CHECKLIST = 5
const RADIOLIST = 6
const DROPLIST = 7
const IMAGE = 8
const FILE = 9
const VALUEDLIST = 10
const SUBMIT = 11
const CANCEL = 12
const MESSAGE = 13

Private Attributes

 $model = null
 $fields = array( )
 $indexes = array( )
 $required = array( )
 $name = null
 $action = null

Detailed Description

Orion form class.

Form creation helper

Author:
Thibaut Despoulain BSD 4-clauses
Version:
0.11.12

Definition at line 19 of file form.php.


Constructor & Destructor Documentation

Orion\Core\Form::__construct ( _name,
_action = '#' 
)

Creates a new form

Definition at line 119 of file form.php.


Member Function Documentation

& Orion\Core\Form::add ( field,
value = null 
)

Add a new field to the form. These functions can be chained like $form->add(...)->add(...) etc.

Parameters:
Orion\Core\ModelField$field
mixed$value
Returns:
Orion instance

Definition at line 134 of file form.php.

& Orion\Core\Form::addBefore ( element,
field,
value = null 
)

Add a new field to the form before given element. These functions can be chained like $form->add(...)->add(...) etc.

Parameters:
stringName of the element before which the field will be added.
Orion\Core\Model\Field$field
mixed$value
Returns:
Orion instance

Definition at line 155 of file form.php.

& Orion\Core\Form::addField ( fieldname,
value = null 
)

Add a new field from model to current form. Similiar to add() but getting its field object from provided model based on field binding.

Parameters:
string$field
mixed$value

Definition at line 174 of file form.php.

& Orion\Core\Form::getField ( name)

Get a field

Parameters:
string$name
Returns:

Definition at line 298 of file form.php.

Orion\Core\Form::getModel ( )

Get bound model

Returns:
Orion

Definition at line 288 of file form.php.

Orion\Core\Form::hydrate ( object)

Hydrate form fields with values stored in provided object (usually for editing purpose)

Parameters:
Object$objectObject to retrives each field values from.

Definition at line 224 of file form.php.

Orion\Core\Form::isMultipart ( )

Tests if the form requires multipart encoding

Returns:
Boolean

Definition at line 307 of file form.php.

Orion\Core\Form::prepare ( model = null)

Prepare this form using provided Model class

Parameters:
String$model

Definition at line 237 of file form.php.

& Orion\Core\Form::remove ( fieldname)

Removes a registered field

Parameters:
string$fieldname
Returns:
Orion instance

Definition at line 201 of file form.php.

Orion\Core\Form::setModel ( _model)

Bind an Orion to the form

Parameters:
Orion\Core\Model$_model

Definition at line 279 of file form.php.

Orion\Core\Form::toHtml ( XHTML = false)

Retreive the HTML version of the form

Parameters:
boolean$XHTMLOutput (x)HTML if set to TRUE instead of pure HTML

Definition at line 253 of file form.php.


Member Data Documentation

Orion::Core\Form::$action = null [private]

Definition at line 114 of file form.php.

Orion::Core\Form::$fields = array( ) [private]

Definition at line 89 of file form.php.

Orion::Core\Form::$indexes = array( ) [private]

Definition at line 96 of file form.php.

Orion::Core\Form::$model = null [private]

Definition at line 83 of file form.php.

Orion::Core\Form::$name = null [private]

Definition at line 108 of file form.php.

Orion::Core\Form::$required = array( ) [private]

Definition at line 102 of file form.php.

const Orion::Core\Form::CANCEL = 12

Cancel button type

Definition at line 73 of file form.php.

const Orion::Core\Form::CHECKBOX = 4

Checkbox input type

Definition at line 41 of file form.php.

const Orion::Core\Form::CHECKLIST = 5

Checkbox list input type

Definition at line 45 of file form.php.

const Orion::Core\Form::DROPLIST = 7

Droplist input type

Definition at line 53 of file form.php.

const Orion::Core\Form::FILE = 9

File browse type

Definition at line 61 of file form.php.

const Orion::Core\Form::HIDDEN = 0

Hidden input type

Definition at line 25 of file form.php.

const Orion::Core\Form::IMAGE = 8

Image browse type

Definition at line 57 of file form.php.

const Orion::Core\Form::MESSAGE = 13

Message type

Definition at line 77 of file form.php.

const Orion::Core\Form::PASSWORD = 2

Passwod input type

Definition at line 33 of file form.php.

const Orion::Core\Form::RADIOLIST = 6

Radio list input type

Definition at line 49 of file form.php.

const Orion::Core\Form::SUBMIT = 11

Submit input type

Definition at line 69 of file form.php.

const Orion::Core\Form::TEXT = 1

Text input type

Definition at line 29 of file form.php.

const Orion::Core\Form::TEXTAREA = 3

Textarea type

Definition at line 37 of file form.php.

const Orion::Core\Form::VALUEDLIST = 10

Valued list input type

Definition at line 65 of file form.php.


The documentation for this class was generated from the following file: