yii2-fileapi-widget

Yii2 FileAPI widget.

Github stars Tracking Chart

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']
        ]
    ]
);

Main metrics

Overview
Name With Ownervova07/yii2-fileapi-widget
Primary LanguagePHP
Program languagePHP (Language Count: 2)
Platform
License:
所有者活动
Created At2014-08-28 17:02:50
Pushed At2018-05-27 17:27:25
Last Commit At2018-05-27 20:27:21
Release Count10
Last Release Name0.1.9 (Posted on 2017-03-24 11:57:12)
First Release Name0.1.0 (Posted on 2014-10-21 20:28:15)
用户参与
Stargazers Count47
Watchers Count11
Fork Count27
Commits Count39
Has Issues Enabled
Issues Count14
Issue Open Count6
Pull Requests Count11
Pull Requests Open Count2
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private