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

這個配置如何使用xupload警予延長

的config.php
'別名'=>陣列(//如果你使用你的作曲家路徑應是 '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 

enter image description here

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

這個例子:http://blueimp.github.io/jQuery-File-Upload/

+0

可能重複的[YII AJAX xupload形式提交不工作(http://stackoverflow.com/questions/11773839/yii-ajax-xupload-form-submit-is-not-working) – Asgaroth 2013-10-14 19:12:17

回答

0

的Widget不能嵌套形式的內部。將它移到我們的表單上,它就可以工作。

0

更改您的Widget代碼。使用'showForm'=> false選項並將id設置爲與主表單具有相同的'htmlOptions'=>數組('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, 
)); ?>