Class: Form
Source Location: /myphp-1.9/myphp-1.9-form/html/component/Form.php
Class Form
Class Overview
|
Generates a html form
- Usage:
- $form = new Form('goHere.php','get');
- $form->add(new SubmitButton($action,$method,$name,$attr,$title,$onsubmit));
- print $form->getHtml();
- Or:
- Form::start($action,$method,$name,$attr,$title,$onsubmit);
- elements::display()
- Form::end();
- Or:
- Form::start($action,$method,$name,$attr,$title,$onsubmit);
- Form::textarea();
- Form::submitbutton();
- :
- Form::end();
Located in /myphp-1.9/myphp-1.9-form/html/component/Form.php [line 62]
Object
|
--Html
|
--Form
|
Properties
|
Methods
|
Inherited Properties, Constants, and Methods
Method Summary
| void |
end() |
Display end html |
| String |
getHidden() |
Returns the html for the hidden fields of a form |
| String |
getStart() |
Returns the html for the start of a form |
| void |
input() |
Display html |
| void |
label() |
Display html |
| void |
radio() |
Display html |
| void |
start() |
Display start html |
Methods
Form Form(
[String
$action = ''], [String
$method = ''], [String
$name = ''], [String
$attr = ''], [String
$title = ''], [String
$onsubmit = '']
)
|
|
Constructor
Parameters:
|
String |
$action: |
The action where to go, default 'self' |
|
String |
$method: |
The method get/post |
|
String |
$name: |
The name if any (NOT xhtml 1.0 strict compliant) |
|
String |
$attr: |
Additional attributes, i.e. 'enctype="multipart/form-data"' |
|
String |
$title: |
The title (tooltip) |
|
String |
$onsubmit: |
The onsubmit event |
void button(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::button($name,$value,$class,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void cancelbutton(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::cancelbuttonbutton($name,$value,$class,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void checkbox(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$checked = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::checkbox($name,$value,$class,$checked,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$checked: |
if present |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void disabled(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$size = ''], [String
$maxlength = ''], [String
$disabled = ''], [String
$readonly = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::disabled($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$size: |
the size |
|
String |
$maxlength: |
the maxlength |
|
String |
$disabled: |
the disabled |
|
String |
$readonly: |
the readonly |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void display(
[String
$action = ''], [String
$method = ''], [String
$name = ''], [String
$attr = ''], [String
$title = ''], [String
$onsubmit = '']
)
|
|
Display html
Parameters:
|
String |
$action: |
The action where to go, default 'self' |
|
String |
$method: |
The method get/post |
|
String |
$name: |
The name if any (NOT xhtml 1.0 strict compliant) |
|
String |
$attr: |
Additional attributes, i.e. 'enctype="multipart/form-data"' |
|
String |
$title: |
The title (tooltip) |
|
String |
$onsubmit: |
The onsubmit event |
API Tags:
Redefinition of:
- Html::display()
- Display the html
void end(
[mixed
$element = '']
)
|
|
Display end html
API Tags:
void fieldsetstart(
[String
$legend = ''], [String
$class = '']
)
|
|
Display html
Parameters:
|
String |
$legend: |
The legend object to use |
|
String |
$class: |
The css class of the link |
API Tags:
void fileupload(
[String
$name = ''], [String
$class = '']
)
|
|
Display html
Parameters:
|
String |
$name: |
the name |
|
String |
$class: |
the class |
API Tags:
Returns the html for the hidden fields of a form
API Tags:
Returns the html for the start of a form
API Tags:
void hidden(
[String
$name = ''], [String
$value = '']
)
|
|
Display html
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
API Tags:
void input(
String
$type, [String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$size = ''], [String
$maxlength = ''], [String
$disabled = ''], [String
$readonly = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::input($type,$name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick);
Parameters:
|
String |
$type: |
the type (text, radio, checkbox, file, button, hidden, submit, reset) |
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$size: |
the size / or checked for radio/checkbox |
|
String |
$maxlength: |
the maxlength |
|
String |
$disabled: |
the disabled |
|
String |
$readonly: |
the readonly |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void label(
String
$text, [String
$id = ''], [String
$class = '']
)
|
|
Display html
Parameters:
|
String |
$text: |
the text to show |
|
String |
$id: |
the ID for the control to relate to |
|
String |
$class: |
the class name |
API Tags:
void legend(
String
$text, [String
$class = ''], [String
$accesskey = '']
)
|
|
Display html
Parameters:
|
String |
$text: |
The text to show |
|
String |
$class: |
The class name |
|
String |
$accesskey: |
The access key |
API Tags:
void option(
String
$text, [String
$value = ''], [String
$selected = '']
)
|
|
Display html
Parameters:
|
String |
$text: |
the text to show |
|
String |
$value: |
the value, if any |
|
String |
$selected: |
The option is selected |
API Tags:
void password(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$size = ''], [String
$maxlength = ''], [String
$disabled = ''], [String
$readonly = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::password($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$size: |
the size |
|
String |
$maxlength: |
the maxlength |
|
String |
$disabled: |
the disabled |
|
String |
$readonly: |
the readonly |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void radio(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$checked = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::radio($name,$value,$class,$checked);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$checked: |
if present |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void readonly(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$size = ''], [String
$maxlength = ''], [String
$disabled = ''], [String
$readonly = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::readonly($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$size: |
the size |
|
String |
$maxlength: |
the maxlength |
|
String |
$disabled: |
the disabled |
|
String |
$readonly: |
the readonly |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void resetbutton(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$onclick = '']
)
|
|
Display html
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void selectstart(
String
$name, [String
$class = ''], [String
$attr = '']
)
|
|
Display html
Parameters:
|
String |
$name: |
The name of the control |
|
String |
$class: |
The class name |
|
String |
$attr: |
Additional atributes |
API Tags:
void start(
[String
$action = ''], [String
$method = ''], [String
$name = ''], [String
$attr = ''], [String
$title = ''], [String
$onsubmit = '']
)
|
|
Display start html
- Usage:
- Form::start($action,$method,$name,$attr,$title,$onsubmit);
Parameters:
|
String |
$action: |
The action where to go, default 'self' |
|
String |
$method: |
The method get/post |
|
String |
$name: |
The name if any (NOT xhtml 1.0 strict compliant) |
|
String |
$attr: |
Additional attributes, i.e. 'enctype="multipart/form-data"' |
|
String |
$title: |
The title (tooltip) |
|
String |
$onsubmit: |
The onsubmit event |
API Tags:
void submitbutton(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$onclick = '']
)
|
|
Display html
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$onclick: |
On click event for javascript |
API Tags:
void textarea(
String
$name, [String
$text = ''], [String
$rows = ''], [String
$cols = ''], [String
$class = '']
)
|
|
Display html
- Usage:
- Form::textarea($name,$text='',$rows='',$cols='',$class='');
Parameters:
|
String |
$name: |
The name of the control |
|
String |
$text: |
The text value, if any |
|
String |
$rows: |
The number of rows |
|
String |
$cols: |
The number of columns |
|
String |
$class: |
The class name |
API Tags:
void textfield(
[String
$name = ''], [String
$value = ''], [String
$class = ''], [String
$size = ''], [String
$maxlength = ''], [String
$disabled = ''], [String
$readonly = ''], [String
$onclick = '']
)
|
|
Display html
- Usage:
- Form::textfield($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick);
Parameters:
|
String |
$name: |
the name |
|
String |
$value: |
the value, if any |
|
String |
$class: |
the class |
|
String |
$size: |
the size |
|
String |
$maxlength: |
the maxlength |
|
String |
$disabled: |
the disabled |
|
String |
$readonly: |
the readonly |
|
String |
$onclick: |
On click event for javascript |
API Tags:
|
|