|
|
File: g:\Work\WWW\php\tbox\lib/ccontrol.phps
PHP Documentation - PHP/Toolbox::Form
CControl
CSnippet | +-- CMarkup | +-- CControl
Basic form control class.
|
private class CControl extends CMarkup
Basic form control class.
Use it to render an input tag somehow like
| new CControl(array(
| "type" => "text", "img", etc.
| ...
| ))
|
|
Direct known subclasses: CCFile, CSelect, CTextarea
|
|
|
|
|
|
Fields inherited from CMarkup |
$attrs |
|
Fields inherited from CSnippet |
$id |
|
Private Field Summary |
string |
$nodataSpecifies that it's not a data control. |
string |
$type |
|
Public Method Details |
CControl |
public void CControl( array $attrs )
|
|
Constructor.
|
Parameter |
|
array |
$attrs |
|
|
No additional comments. |
|
Returns |
void |
|
|
Private Method Details |
render |
private void render( )
|
|
Main rendering method.
It never has to be used directly, use it via the parent form method
$form->renderControl($form->controls["name"]);
instead.
No additional comments.
|
Returns |
void |
|
renderReadonly |
private void renderReadonly( )
|
|
Readonly rendering method.
It's called by parent form when in Readonly mode.
It produces a plain text and a hidden field.
No additional comments.
|
Returns |
void |
|
getValue |
private mixed getValue( )
|
|
Returns control's value.
Use this also to override the data handling,
e.g. to process special data formats.
Note, stripslashes allow us to ignore magic_quotes_gpc setting.
|
Returns |
mixed - value. |
|
outValue |
private mixed outValue( )
|
|
Control's value to output from the form.
Use this to override the data handling,
e.g. to process special data formats.
|
Returns |
mixed - out value. |
|
inValue |
private mixed inValue( mixed $value )
|
|
Control's value to input to form.
Use this to override the data handling,
e.g. to process special data formats.
| $rset = do_query ($sql);
| while (fetch_record($rset, $rec)) {
| foreach ($rec as $fname => $value) {
| global $$fname;
| $$fname = inValue($value);
| }
| }
...
| function inValue ($value) {
| // handle the set
| return split(",", $value);
| }
|
Parameter |
|
|
Returns |
mixed - in value ($value by default). |
|
validateValue |
private mixed validateValue( )
|
|
Verifies the control's data.
Use this to override the data verification,
e.g. to process special data formats.
Note that error message is eval'ed, so, you
can use "\$value" to insert error data.
|
Returns |
mixed - control validation result. |
|
|
Private Field Details |
$nodata |
private string $nodata
>>FALSE <<
Specifies that it's not a data control.
I.e., there is no direct correspondence to
some database field.
|
|
$type |
private string $type
>>"" <<
|
|
|
|
|
PHPDoc 1.0beta |