|
|
File: g:\Work\WWW\php\tbox\lib/ccfile.phps
PHP Documentation - PHP/Toolbox::Form
CCFile
CSnippet | +-- CMarkup | +-- CControl | +-- CCFile
The CForm control for file uploading.
|
private class CCFile extends CControl
The CForm control for file uploading.
| new CFile(array(
| "label" => ...,
| "do" => $DO,
| "upload_dir" => "$DOCUMENT_ROOT/upload/"
| ))
|
|
|
|
|
|
|
|
Fields inherited from CControl |
$nodata |
|
|
Fields inherited from CSnippet |
$id |
|
|
Public Method Details |
CCFile |
public void CCFile( $attrs )
|
|
No additional comments.
|
Parameter |
|
|
$attrs |
|
|
No additional comments. |
|
Returns |
void |
|
|
Private Method Details |
outValue |
private void outValue( )
|
|
Control's value to output from the form.
Use this to override the data handling,
e.g. to process special data formats.
No additional comments.
|
Returns |
void |
|
acceptUpload |
private void acceptUpload( $tmpfile, $oldfile, $abs_path, $upload_dir )
|
|
Accepts uploaded file
and moves it to permanent location.
|
Parameter |
|
|
$tmpfile |
|
|
No additional comments. |
|
$oldfile |
|
|
No additional comments. |
|
$abs_path |
|
|
No additional comments. |
|
$upload_dir |
|
|
No additional comments. |
|
Returns |
void |
|
doUploadFile |
private void doUploadFile( $tmpfile, $oldfile, $abs_path, $upload_dir )
|
|
Performs the file uploading and database operation logic.
|
Parameter |
|
|
$tmpfile |
|
|
No additional comments. |
|
$oldfile |
|
|
No additional comments. |
|
$abs_path |
|
|
No additional comments. |
|
$upload_dir |
|
|
No additional comments. |
|
Returns |
void |
|
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 |
|
|
Private Field Details |
$do |
private string $do
>>"" <<
The operation:
- INS - insert a record
- EDIT - modify a record
- DEL - delete a record
|
|
$type |
private string $type
>>"file" <<
|
|
$abs_path |
private string $abs_path
>>"/tmp" <<
|
|
$upload_dir |
private string $upload_dir
>>"" <<
|
|
|
|
|
PHPDoc 1.0beta |