rahulabs / yii2-img-selector
Yii2 widget ImgSelector
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:CSS
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-01-08 10:05:46 UTC
README
If you made a file manager in TinyMCE, you could connect Responsive File Manager (RFM). Then ask yourself: why can't I fill in inputs with the names of the file that is selected? So to say: "Doctor's photo" -> "Browse" -> "Save".
I made such a widget for myself. Basically, you need to download RFM, place it in a certain folder, in the backend/web/
folder and specify this path to it in backend/config/bootstrap.php
.
Use: ->widget(\rahulabs\yii2\imgSelector\ImageSelector::className())
on the required field in the admin form.
Add Constant WEBSITE_URL in your project as domain URL: http://localhost
Install
composer require rahulabs/yii2-img-selector
frontend/config/bootstrap.php
Yii::$container->set('rahulabs\yii2\imgSelector\ImageSelector', [ 'fileManagerPathTpl' => '/adm-scripts/responsivefilemanager/filemanager/dialog.php?type=1&field_id=%s&relative_url=0&callback=ImageSelectorCallBack' ]);
backend/view/test/test.php
echo $form ->field($model, 'main_image') ->widget(\rahulabs\yii2\imgSelector\ImageSelector::className());