rahulabs/yii2-img-selector

There is no license information available for the latest version (1.0.1) of this package.

Yii2 widget ImgSelector

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:CSS

Type:yii2-extension

1.0.1 2024-08-06 08:19 UTC

This package is auto-updated.

Last update: 2024-09-06 08:29:53 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());