Class CMultiFileUpload
CMultiFileUpload generates a file input that can allow uploading multiple files at a time.
This is based on the jQuery Multi File Upload plugin. The uploaded file information can be accessed via $_FILES[widget-name], which gives an array of the uploaded files. Note, you have to set the enclosing form's 'enctype' attribute to be 'multipart/form-data'.
Example:
<?php $this->widget('CMultiFileUpload', array( 'model'=>$model, 'attribute'=>'files', 'accept'=>'jpg|gif', 'options'=>array( 'onFileSelect'=>'function(e, v, m){ alert("onFileSelect - "+v) }', 'afterFileSelect'=>'function(e, v, m){ alert("afterFileSelect - "+v) }', 'onFileAppend'=>'function(e, v, m){ alert("onFileAppend - "+v) }', 'afterFileAppend'=>'function(e, v, m){ alert("afterFileAppend - "+v) }', 'onFileRemove'=>'function(e, v, m){ alert("onFileRemove - "+v) }', 'afterFileRemove'=>'function(e, v, m){ alert("afterFileRemove - "+v) }', ), )); ?>
- CComponent
- CBaseController
- CWidget
- CInputWidget
- CMultiFileUpload
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/widgets/CMultiFileUpload.php
public
|
|
public
|
|
protected
array
|
hasModel(),
resolveNameID()
|
__construct(),
actions(),
getController(),
getId(),
getOwner(),
getViewFile(),
getViewPath(),
init(),
render(),
setId()
|
beginCache(),
beginClip(),
beginContent(),
beginWidget(),
createWidget(),
endCache(),
endClip(),
endContent(),
endWidget(),
renderFile(),
renderInternal(),
widget()
|
public
string
|
$accept |
|
#
the file types that are allowed (eg "gif|jpg"). Note, the server side still needs to check if the uploaded files have allowed types. |
public
integer
|
$max | -1 |
#
the maximum number of files that can be uploaded. If -1, it means no limits. Defaults to -1. |
public
string
|
$remove |
|
#
the label for the remove button. Defaults to "Remove". |
public
string
|
$denied |
|
#
message that is displayed when a file type is not allowed. |
public
string
|
$selected |
|
#
message that is displayed when a file is selected. |
public
string
|
$duplicate |
|
#
message that is displayed when a file appears twice. |
public
string
|
$file |
|
#
the message template for displaying the uploaded file name |
public
array
|
$options | array() |
#
additional options that can be passed to the constructor of the multifile js object. |
$attribute,
$htmlOptions,
$model,
$name,
$value
|
$actionPrefix,
$skin
|
$controller,
$id,
$owner,
$viewPath
|