title = 'Документы'; $this->params['breadcrumbs'][] = ['label' => 'Документы', 'url' => ['index'] ]; $ucat = Yii::$app->request->get('cat', ''); if( $ucat ){ $this->params['breadcrumbs'][] = ['label' => $ucat, 'url' => ['index', 'cat'=>$ucat]]; } $croute = '/manager/docs'; $rootcat = $model->GetRootCat(); $curcat = $model->GetCat(); $cat = yii\helpers\FileHelper::findDirectories($curcat); $files = yii\helpers\FileHelper::findFiles($curcat,['recursive'=>false]); $ckey = 'dosc_cat_'.md5($ucat); Yii::$app->cache->delete($ckey); $docs = Yii::$app->cache->getOrSet( $ckey, function () use ($model, $ucat) { return $model->find()->where(['cat'=>$ucat?$ucat:null])->all(); },2 ); //var_dump($docs); $docsf = []; foreach($docs as $key => $item){ $docsf[$item->uid] = $key; } //$docsf = array_flip( yii\helpers\ArrayHelper::getColumn($docs, "uid") ); ?> session->hasFlash('success')): ?>
info!
session->getFlash('success');?>

$ucat], ['class' => 'btn btn-success']) ?> 'btn btn-success']) ?> $ucat ], ['class' => 'btn btn-success']) ?>

Папка

assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [ 'css' => [], 'js' => [] ]; ?> $model, 'attribute' => 'file', 'url' => ['docsupload', 'id' => 0, 'cat'=>$ucat], 'options' => ['accept' => '*'], 'clientOptions' => [ 'limitConcurrentUploads' => 3, 'disableImageMetaDataLoad' => true, 'autoUpload' => true, ], // ... 'clientEvents' => [ 'fileuploaddone' => 'function(e, data) { res = JSON.parse(data.result); $("#filesbox").append(" "+res.files[0].name+""); var obj = poper.get(res.files[0].oname); setTimeout(() => { obj.css("display", "none"); }, 2000); e.preventDefault(); }', 'fileuploadfail' => 'function(e, data) { // console.log(e); console.log(data); e.preventDefault(); }', 'fileuploadchange' => 'function(e, data) { starting(e, data); }', 'fileuploaddrop' => 'function(e, data) { starting(e, data); }', 'fileuploadprogress' =>'function(e,data) { e.preventDefault(); progress = parseInt(data.loaded / data.total * 100, 10); var obj = poper.get(data.files[0].name); obj.find(".progress-bar").css("width", progress+"%"); }', 'fileuploadstop' => 'function(e) { console.log("fin"); setTimeout(() => { window.location.reload(); }, 3000); }' ], ]); ?> registerJs(<<