在XUpload Yii中重复上传视图

时间:2017-07-14 09:09:36

标签: php yii yii-xupload

我需要两个上传文件,在一个页面中有两个上传视图,在Yii中有扩展名XUpload,但渲染第一个上传视图。

$model = new MMediaUploadForm;
    $url = aUrl('/project/media/upload', array('projectId' => $this->project->id));
    $this->widget('uniprogy.extensions.xupload.XUpload', array(

        'url' => $url,
        'model' => $model,
        'attribute' => 'file',
        'downloadView' => $this->render('download', array('listWorkletId' => $this->getDOMId()), true),
        'uploadView' => $this->render('upload', array(), true),
        'uploadTemplate' => '#template-upload',
        'formView' => $this->render('form', array(
            'url' => $url,
            'model' => $model,
            'attribute' => 'file',
            'htmlOptions' => array(
                'id' => get_class($model) . "-form",
                'enctype' => 'multipart/form-data',
            ),
        ), true),

    ));

$url1 = aUrl('/project/media/upload1', array('projectId' => $this->project->id));
    $this->widget('uniprogy.extensions.xupload.XUpload', array(

        'url' => $url1,
        'model' => $model,
        'attribute' => 'file',
        'downloadView' => $this->render('download', array('listWorkletId' => $this->getDOMId()), true),
        'uploadView' => $this->render('upload1', array(), true),
        'uploadTemplate' => '#template-upload1',
        'formView' => $this->render('form1', array(
            'url' => $url1,
            'model' => $model,
            'attribute' => 'file',
            'htmlOptions' => array(
                'id' => get_class($model) . "-form",
                'enctype' => 'multipart/form-data',
            ),
        ), true),

    ));

我有两个带有两个id的text / x-tmpl,但只是渲染第一个上传视图! 帮帮我,谢谢!

0 个答案:

没有答案