yii2-fileapi-widget

Yii2 FileAPI widget.

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者vova07/yii2-fileapi-widget
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證
所有者活动
創建於2014-08-28 17:02:50
推送於2018-05-27 17:27:25
最后一次提交2018-05-27 20:27:21
發布數10
最新版本名稱0.1.9 (發布於 2017-03-24 11:57:12)
第一版名稱0.1.0 (發布於 2014-10-21 20:28:15)
用户参与
星數47
關注者數11
派生數27
提交數39
已啟用問題?
問題數14
打開的問題數6
拉請求數11
打開的拉請求數2
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?