Class NFileUpload


Text box and browse button that allow users to select a file to upload to the server.

NObject
   |
   --NComponent
      |
      --NFormControl
         |
         --NFileUpload
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Forms/Controls/FileUpload.php (line 33)
Public Method Summary
NFileUpload
__construct ([string $label = NULL])
NFileUpload
setValue (array|NHttpUploadedFile $value)
Sets control's value.
static bool
validateFileSize (NFileUpload $control, int $limit)
FileSize validator: is file size in limit?
static bool
Filled validator: has been any file uploaded?
static bool
validateMimeType (NFileUpload $control, array|string $mimeType)
MimeType validator: has file specified mime type?
Protected Method Summary
protected void
attached (IComponent $form)
This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
Methods Inherited From NFormControl
__construct(), addCondition(), addConditionOn(), addError(), addRule(), attached(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDisabled(), setHtmlId(), setOption(), setParent(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From NComponent
__construct(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent(), __clone(), __wakeup()
Methods Inherited From NObject
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary

Method Details

line 39

__construct

public NFileUpload __construct ([string $label = NULL])

Input
string $label label
Output
NFileUpload  

line 53

attached

protected void attached (IComponent $form)

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.

Input
IComponent $form
Output
void  

line 71

setValue

public NFileUpload setValue (array|NHttpUploadedFile $value)

Sets control's value.

Input
array|NHttpUploadedFile $value
Output
NFileUpload provides a fluent interface

line 106

validateFileSize

public static bool validateFileSize (NFileUpload $control, int $limit)

FileSize validator: is file size in limit?

Input
NFileUpload $control
int $limit file size limit
Output
bool  

line 92

validateFilled

public static bool validateFilled (IFormControl $control)

Filled validator: has been any file uploaded?

Input
IFormControl $control
Output
bool  

line 120

validateMimeType

public static bool validateMimeType (NFileUpload $control, array|string $mimeType)

MimeType validator: has file specified mime type?

Input
NFileUpload $control
array|string $mimeType mime type
Output
bool