vova07/yii2-fileapi-widget The FileAPI widget for Yii2 framework.

widgetuploadfilesfileapimultiupload

WARNING: This extension is not more maintained (The base JS script FileAPI was deprecated)

Yii2 FileAPI widget.

This widget is a Yii 2 wrapper of FileAPI plugin.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist vova07/yii2-fileapi-widget "*"

or add

"vova07/yii2-fileapi-widget": "*"

to the require section of your composer.json file.

Usage:

// MyController.php

use vova07\fileapi\actions\UploadAction as FileAPIUpload;
...

public function actions()
{
    return [
        'fileapi-upload' => [
            'class' => FileAPIUpload::className(),
            'path' => '/path/to/temp/files'
        ]
    ];
}
// MyModel.php

use vova07\fileapi\behaviors\UploadBehavior;
...

public function behaviors()
{
    return [
        'uploadBehavior' => [
            'class' => UploadBehavior::className(),
            'attributes' => [
                'preview_url' => [
                    'path' => '/path/to/previews',
                    'tempPath' => '/path/to/temp/files/previews',
                    'url' => '/url/to/previews'
                ],
                'image_url' => [
                    'path' => '/path/to/images',
                    'tempPath' => '/path/to/temp/files/images',
                    'url' => '/url/to/images'
                ]
            ]
        ]
    ];
}
// _form.php

use vova07\fileapi\Widget as FileAPI;
...

echo $form->field($model, 'preview_url')->widget(
    FileAPI::className(),
    [
        'settings' => [
            'url' => ['/controller/fileapi-upload']
        ]
    ]
);

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.1.9 is the latest of 10 releases



BSD-3-Clause license
Stats
49 github stars & 27 github forks
31 downloads in the last day
315 downloads in the last 30 days
57905 total downloads