user->identity->uuid . '/schet'; self::$act_path = \Yii::getAlias('@webroot') . '/invoices/' . \Yii::$app->user->identity->uuid . '/act'; parent::init(); // TODO: Change the autogenerated stub } public function actionIndex() { $scheta = new ArrayDataProvider([ 'allModels' => \yii\helpers\FileHelper::findFiles(self::$schet_path) ]); $actu = new ArrayDataProvider([ 'allModels' => \yii\helpers\FileHelper::findFiles(self::$act_path) ]); /* $files = array(); if (file_exists($schet_path)) { $fileNames = array_diff(scandir($schet_path), array('..', '.')); foreach ($fileNames as $fileName) { //echo Html::img($webPath . '/' . $fileName); $files[] = $fileName; } }*/ return $this->render('index', [ 'scheta' => $scheta, 'actu' => $actu ]); } public function actionDownload($type, $file) { $schet_path = \Yii::getAlias('@webroot') . '/invoices/' . \Yii::$app->user->identity->uuid . '/'.$type.'/'; return \Yii::$app->response->sendFile($schet_path. $file); } }