Public Member Functions |
| __construct ($action=NULL, $title= '', $method=NULL, $attr=array()) |
| Form constructor.
|
| __get ($key) |
| Magic __get method.
|
| __call ($method, $args) |
| Magic __call method.
|
| set_attr ($key, $val=NULL) |
| Set a form attribute.
|
| validate () |
| Validates the form by running each inputs validation rules.
|
| as_array ($clean=TRUE) |
| Returns the form as an array of input names and values.
|
| error_format ($string= '') |
| Changes the error message format.
|
| html ($template= 'forge_template', $custom=FALSE) |
| Creates the form HTML.
|
| __toString () |
| Returns the form HTML.
|
Public Attributes |
| $inputs = array() |
| $hidden = array() |
| $error_format = '<p class="error">{message}</p>' |
| $newline_char = "\n" |
| $visible = NULL |
Protected Attributes |
| $template |
| $attr = array() |
Constructor & Destructor Documentation
Forge::__construct |
( |
|
$action = NULL , |
|
|
|
$title = '' , |
|
|
|
$method = NULL , |
|
|
|
$attr = array() |
|
) |
| |
Form constructor.
Sets the form action, title, method, and attributes.
- Returns
- void
Member Function Documentation
Forge::__call |
( |
|
$method, |
|
|
|
$args |
|
) |
| |
Magic __call method.
Creates a new form element object.
- Exceptions
-
- Parameters
-
string | input type |
string | input name |
- Returns
- object
Magic __get method.
Returns the specified form element.
- Parameters
-
- Returns
- object
Reimplemented in Form_Group.
Forge::as_array |
( |
|
$clean = TRUE | ) |
|
Returns the form as an array of input names and values.
- Parameters
-
boolean | clean If set to TRUE (default) returned values are escaped Otherwise they are not. |
- Returns
- array
Forge::error_format |
( |
|
$string = '' | ) |
|
Changes the error message format.
Your message formatting must contain a {message} placeholder.
- Exceptions
-
- Parameters
-
- Returns
- void
Forge::html |
( |
|
$template = 'forge_template' , |
|
|
|
$custom = FALSE |
|
) |
| |
Creates the form HTML.
- Parameters
-
string | form view template name |
boolean | use a custom view |
- Returns
- string
Reimplemented in Form_Group.
Forge::set_attr |
( |
|
$key, |
|
|
|
$val = NULL |
|
) |
| |
Set a form attribute.
This method is chainable.
- Parameters
-
string|array | attribute name, or an array of attributes |
string | attribute value |
- Returns
- object
Validates the form by running each inputs validation rules.
- Returns
- bool
Member Data Documentation
Initial value: array
(
'title' => '',
'class' => '',
'open' => '',
'close' => '',
)
The documentation for this class was generated from the following file: