zrk4939 / yii2-files-module
Files Module
Installs: 102
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.0
- ext-exif: *
- ext-gd: *
- boundstate/yii2-plupload: *
- fortawesome/font-awesome: ^4.7
- npm-asset/lightbox2: ^2.10
- yiisoft/yii2: *
- yiisoft/yii2-jui: ^2.0
README
DOES NOT WORK
Files manager module for the Yii2 framework
Installation
add
"zrk4939/files-module": "@dev",
to the require section of your composer.json
file.
and
{
"type": "vcs",
"url": "https://github.com/zrk4939/files-module.git"
}
to the repositories array of your composer.json
file.
Usage
main.php
'files' => [ 'class' => 'zrk4939\modules\files\FilesModule', 'extensions' => ['png', 'jpg', 'jpeg', 'gif', 'pdf', 'txt', 'zip'], 'uploadPath' => '@webroot/uploads', 'rootPath' => '@webroot', ],
i18n
'files*' => [ 'class' => 'yii\i18n\PhpMessageSource', 'sourceLanguage' => 'en-US', 'basePath' => "@zrk4939/modules/files/messages", 'fileMap' => [ 'files' => 'translation.php', ] ],
Widget
<?php echo $form->field($model, 'images_arr')->widget(\zrk4939\modules\files\widget\FilesWidget::className(), [ 'multiple' => true, 'files' => $model->images, 'types' => [ 'image/*' ] ]); ?>
CKEditor options
$imageTypes = Json::encode([ 'image/*' ]); 'editorOptions' => [ 'filebrowserBrowseUrl' => Url::to(['/files/manage/index', 'frame' => 1]), 'filebrowserImageBrowseUrl' => Url::to(['/files/manage/index', 'frame' => 1, 'types' => $imageTypes]), ],