Код: Выделить всё
widget('ext.EAjaxUpload.EAjaxUpload', // параметры для загрузки файлов array( 'id'=>'uploadFile', 'config'=>array( 'action'=>Yii::app()->createUrl('/adm/models/upload'), 'allowedExtensions'=>array("jpg","jpeg","png","pdf"),//array("jpg","jpeg","gif","exe","mov" and etc... 'sizeLimit'=>10*1024*1024,// maximum file size in bytes 'onComplete' => "js:function(id, fileName, responseJSON){ if($('#gall').val() == '') $('#gall').val(fileName); else $('#gall').val($('#gall').val() + '|' + fileName); }", ) )); ?>
Код: Выделить всё
<?php echo $form->labelEx($model,'gallery'). '<br/>'; ?>
<? $this->widget('ext.EAjaxUpload.EAjaxUpload', // параметры для загрузки файлов
array(
'id'=>'uploadFile',
'config'=>array(
'action'=>Yii::app()->createUrl('/adm/models/upload'),
'allowedExtensions'=>array("jpg","jpeg","png","pdf"),//array("jpg","jpeg","gif","exe","mov" and etc...
'sizeLimit'=>10*1024*1024,// maximum file size in bytes
'onComplete' => "js:function(id, fileName, responseJSON){
if($('#gall').val() == '') $('#gall').val(fileName);
else $('#gall').val($('#gall').val() + '|' + fileName);
}",
)
)); ?>
<?php echo $form->textField($model,'gallery', array('id'=>'gall')); ?>
<?php echo $form->error($model,'gallery'); ?>