2017 © Pedro Peláez
 

yii2-extension yii2-fileapi-sae

The FileAPI widget for Yii2 framework. adapt for sina app engin

image

postor/yii2-fileapi-sae

The FileAPI widget for Yii2 framework. adapt for sina app engin

  • Sunday, May 31, 2015
  • by postor
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 FileAPI widget.

This widget is a Yii 2 wrapper of FileAPI plugin., (*1)

this is an adapt for sina app engine, (*2)

this is based on https://github.com/vova07/yii2-fileapi-widget, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist "postor/yii2-fileapi-sae" "*"

or add, (*6)

"postor/yii2-fileapi-sae": "*"

to the require section of your composer.json file., (*7)

Usage:

// MyController.php

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

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

use postor\fileapi\behaviors\UploadBehavior;
...

public function behaviors()
{
    return [
        'uploadBehavior' => [
            'class' => UploadBehavior::className(),
            'attributes' => [
                'preview_url' => [
                    'path' => 'saestor://upload/temp',
                    'tempPath' => 'saestor://upload/category',
                    'url' => $saeStorage->getUrl('upload','category'),
                ],
            ]
        ]
    ];
}
// _form.php

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

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

demo project: http://yii2postor.sinaapp.com/web/index.php?r=admin%2Fcategory%2Fupdate&id=2, (*8)

The Versions

31/05 2015

dev-master

9999999-dev

The FileAPI widget for Yii2 framework. adapt for sina app engin

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar postor

yii2 upload yii 2 widget files fileapi multiupload

31/05 2015

0.0.1

0.0.1.0

The FileAPI widget for Yii2 framework. adapt for sina app engin

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar postor

yii2 upload yii 2 widget files fileapi multiupload