Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionActiveForm
  • ActionActiveFormBase
  • CActiveForm
  • CalendarEventActiveForm
  • CallActiveForm
  • CClipWidget
  • CContentDecorator
  • CFilterWidget
  • CFlexWidget
  • CHtmlPurifier
  • CInputWidget
  • CMarkdown
  • CMaskedTextField
  • CMultiFileUpload
  • COutputCache
  • COutputProcessor
  • CStarRating
  • CTabView
  • CTextHighlighter
  • CTreeView
  • CWidget
  • EventActiveForm
  • MobileActiveForm
  • NoteActiveForm
  • TimeActiveForm
  • X2ActiveForm
  • X2StarRating
  • Overview
  • Package
  • Class
  • Tree

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
Extended by CBaseController
Extended by CWidget
Extended by CInputWidget
Extended by CMultiFileUpload
Package: system\web\widgets
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
Methods summary
public
# run( )

Runs the widget. This method registers all needed client scripts and renders the multiple file uploader.

Runs the widget. This method registers all needed client scripts and renders the multiple file uploader.

Overrides

CWidget::run()
public
# registerClientScript( )

Registers the needed CSS and JavaScript.

Registers the needed CSS and JavaScript.

protected array
# getClientOptions( )

Returns

array
the javascript options
Methods inherited from CInputWidget
hasModel(), resolveNameID()
Methods inherited from CWidget
__construct(), actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), init(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
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.

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.

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".

the label for the remove button. Defaults to "Remove".

public string $denied
#

message that is displayed when a file type is not allowed.

message that is displayed when a file type is not allowed.

public string $selected
#

message that is displayed when a file is selected.

message that is displayed when a file is selected.

public string $duplicate
#

message that is displayed when a file appears twice.

message that is displayed when a file appears twice.

public string $file
#

the message template for displaying the uploaded file name

the message template for displaying the uploaded file name

Since

1.1.3
public array $options array()
#

additional options that can be passed to the constructor of the multifile js object.

additional options that can be passed to the constructor of the multifile js object.

Since

1.1.7
Properties inherited from CInputWidget
$attribute, $htmlOptions, $model, $name, $value
Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
API documentation generated by ApiGen 2.8.0