Public Member Functions |
| __construct ($name) |
| Sets the input element name.
|
| __call ($method, $args) |
| Sets form attributes, or return rules.
|
| __get ($key) |
| Returns form attributes.
|
| matches ($input) |
| Sets a form element that this element must match the value of.
|
| callback ($callback) |
| Sets a callback method as a rule for this input.
|
| name ($val=NULL) |
| Sets name.
|
| label ($val=NULL) |
| Sets or returns the input label.
|
| help ($val=NULL) |
| Sets help.
|
| script ($type, $val=NULL) |
| Sets script.
|
| message ($val=NULL) |
| Set or return the error message.
|
| html () |
| Runs validation and returns the element HTML.
|
| add_error ($key, $val) |
| Add an error to the input.
|
| error_messages ($func=NULL, $message=NULL) |
| Set or return the error messages.
|
| validate () |
| Validate this input based on the set rules.
|
Public Attributes |
| $method |
Protected Attributes |
| $data |
| $protect = array() |
| $rules = array() |
| $matches = array() |
| $callbacks = array() |
| $is_valid |
| $errors = array() |
| $error_messages = array() |
Member Function Documentation
Form_Input::__call |
( |
|
$method, |
|
|
|
$args |
|
) |
| |
Form_Input::__get |
( |
|
$key | ) |
|
Form_Input::add_error |
( |
|
$key, |
|
|
|
$val |
|
) |
| |
Add an error to the input.
- Returns
- object
Form_Input::add_rules |
( |
array |
$rules, |
|
|
|
$action |
|
) |
| |
|
protected |
Replace, remove, or append rules.
- Parameters
-
array | rules to change |
string | action to use: replace, remove, append |
Form_Input::callback |
( |
|
$callback | ) |
|
Sets a callback method as a rule for this input.
- Parameters
-
- Returns
- Form_Input
Form_Input::error_messages |
( |
|
$func = NULL , |
|
|
|
$message = NULL |
|
) |
| |
Set or return the error messages.
- Parameters
-
string|array | failed validation function, or an array of messages |
string | error message |
- Returns
- object|array
Form_Input::help |
( |
|
$val = NULL | ) |
|
Form_Input::html_element |
( |
| ) |
|
|
protected |
Form_Input::input_value |
( |
| ) |
|
|
protected |
Get the global input value.
- Returns
- string|bool
Form_Input::label |
( |
|
$val = NULL | ) |
|
Sets or returns the input label.
- Parameters
-
- Returns
- Form_Input
Form_Input::load_value |
( |
| ) |
|
|
protected |
Form_Input::matches |
( |
|
$input | ) |
|
Sets a form element that this element must match the value of.
- Parameters
-
object | another Forge input |
- Returns
- Form_Input
Form_Input::message |
( |
|
$val = NULL | ) |
|
Set or return the error message.
- Parameters
-
- Returns
- Form_Input
Form_Input::name |
( |
|
$val = NULL | ) |
|
Check if value is GPS coordinate if it is not empty.
- Author
- Ondřej Fibich
Form_Input::rule_preg_regex |
( |
| ) |
|
|
protected |
Check if value is pregex if it is not empty.
- Author
- Ondřej Fibich
Form_Input::script |
( |
|
$type, |
|
|
|
$val = NULL |
|
) |
| |
Member Data Documentation
Initial value: array
(
'type' => 'text',
'class' => 'textbox',
'value' => ''
)
The documentation for this class was generated from the following file: