0
I want to use upload multiple with xupload extension,
but didn't work my code?

这个配置

config.php
'aliases' => array( //如果你使用 composer 你的路径应该是 'xupload' => 'ext.vendor.Asgaroth.xupload', //如果你手动安装它 'xupload' => 'ext. xupload', ),

     and  the Widget in views 
    <?php   $this->widget('xupload.XUpload', array(
                        'url' => Yii::app()->createUrl("site/upload"),
                        'model' => $model,
                        'attribute' => 'file',
                        'multiple' => true,
    ));  ?>
     and controller
    class SiteController extends CController
    {
        public function actions()
        {
            return array(
                'upload'=>array(
                    'class'=>'xupload.actions.XUploadAction',
                    'path' =>Yii::app() -> getBasePath() . "/../uploads",
                    'publicPath' => Yii::app() -> getBaseUrl() . "/uploads",
                ),
            );
        }
    }
and this view my application  

在此处输入图像描述

but don't work, please help to solve my problem,
thanks ?

这个例子:http ://blueimp.github.io/jQuery-File-Upload/

4

2 回答 2

0

小部件不能嵌套在表单中。将它移到我们的表单中,它会起作用。

于 2013-08-05T17:07:00.213 回答
0

更改您的小部件代码。使用 'showForm' => false 选项并将 id 设置为与您的主表单具有 'htmlOptions' => array('id'=>'your-main-form-id',) 相同。它会在你的表单中工作。

<?php   $this->widget('xupload.XUpload', array(
                    'url' => Yii::app()->createUrl("site/upload"),
                    'htmlOptions' => array('id'=>'your-main-form-id',),
                    'model' => $model,
                    'attribute' => 'file',
                    'multiple' => true,
                    'showForm' => false,
));  ?>
于 2014-02-06T08:55:13.227 回答