Class: SForm_Elm_Text
Source Location: /SForm.php
Class SForm_Elm_Text
Class Overview
|
A text element
A text element is a small input box for text. If the attribute 'maxlength' is set, the rule SForm_Rule_Maxlength will be added, and the maximum length of this attribute will be enforced on the server.
Located in /SForm.php [line 3618]
SForm_Element
|
--SForm_Elm_Text
|
Methods
|
Inherited Properties, Constants, and Methods
Methods
SForm_Elm_Text __construct(
[string
$id = null], [string
$label = null], [array
$attributes = null]
)
|
|
Add text type info
Parameters:
|
string |
$id: |
Local ID of this element |
|
string |
$label: |
Label of this element |
|
array |
$attributes: |
Any extra attributes |
API Tags:
Redefinition of:
- SForm_Element::__construct()
- Construct with an identity. Optionally add a label and more attributes.
void setAttribute(
string
$attr, [string
$value = null]
)
|
|
Handle 'maxlength'
SForm_Elm_Text will automatically add the rule SForm_Rule_Maxlength to itself if the attribute 'maxlength' is set.
Parameters:
|
string |
$attr: |
Attribute to set |
|
string |
$value: |
Value to set (sets value = attribute if null) |
API Tags:
Redefinition of:
- SForm_Element::setAttribute()
- Set an attribute in $this
|
|