Module manager gallery, upload image
Add
"sya/yii2-gallery": "~1.0"
to the require section of your composer.json file.
use sya\gallery\Module;
'modules' => [
'gallery' => [
'class' => 'sya\gallery\Module',
'syaDirPath' => '@webroot/',
'syaDirUrl' => '@web/',
'syaDirUpload' => 'uploads',
],
]
use sya\gallery\models\Gallery;
$form->field($model, 'gallery'])->widget(Gallery::className(), [
'columns' => [
'status' => [
'title' => 'Status',
'displayType' => Gallery::SYA_TYPE_COLUMN_DROPDOWN,
'items' => [
'0' => 'Ẩn',
'1' => 'Hiện'
]
],
]
]),
use sya\gallery\Image;
$form->field($model, 'image', ['horizontalCssClasses' => []])->widget(Image::className(), [
'class_button' => 'form-control button_color ',
])
yii2-gallery is released under the MIT License. See the bundled LICENSE.md for details.