2017 © Pedro Peláez
 

library yii2-uploadcare

Yii2 wrapper for uploadcare service

image

slawap/yii2-uploadcare

Yii2 wrapper for uploadcare service

  • Thursday, June 29, 2017
  • by slawap
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Yii2 wrapper for Uploadcare PHP package

Uploadcare handles uploading, storing and processing files for you. All components of Uploadcare, from widget to CDN, work seamlessly together, require almost no configuration and allow maximum flexibility exactly when you need it., (*1)

Latest Stable Version Total Downloads Build Status, (*2)

PHP Library, (*3)

Uploadcare documentation, (*4)

Configuration

Api is a yii2 component, which is a facade to \Uploadcare\Api., (*5)

Example config:, (*6)

'components' => [
    'uploadcare' => [
        'class' => 'uploadcare\yii2\Api',
        'publicKey' => 'your_public_key',
        'secretKey' => 'your_secret_key',
        'globalWidgetOptions' => [
            'UPLOADCARE_LOCALE' => 'ru',
        ]
    ]
]

globalWidgetOptions - allow you set global options for all call of widget. supported options, (*7)

Widget

Show file(s) input widget, (*8)

Example call:, (*9)


use uploadcare\yii2\UploadCare; echo $form->field($model, 'logo')->widget( UploadCare::className(), [ 'options' => [ 'data' => [ 'multiple' => true ] ], 'validators' => [ new \yii\web\JsExpression('function (fileInfo) { console.log("test1"); }'), new \yii\web\JsExpression('function (fileInfo) { console.log("test2"); }') ] ] );

Local widget settings you can set using html5 data attributes. supported options, (*10)

Validators allow restricting user choice to certain kind of files., (*11)

Store file(s) permanently and set UUID to model attribute

Example config:, (*12)

    public function behaviors()
    {
        return [
            'logo' => [
                'class' => FilesBehavior::class,
                'groupUUID' => false,
                'attributes' => ['logo']
            ]
        ];
    }

File(s)Behavior call api method for save file(s) permanently., (*13)

FilesBehavior - set UIID to model attribute, (*14)

FilesBehavior - group UIID or files UIID array (depending on the groupUUID attribute) to model attribute., (*15)

Show images

Image helper generates an image tag by UUID, (*16)

Example:, (*17)

echo Image::img($uuid, $options); //draw img tag
echo Image::img($image, ['width' => '100'])->resize(200)->crop(100,100); //resize and crop image, then render img tag 

The Versions

29/06 2017

dev-master

9999999-dev

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

29/06 2017

0.2.5

0.2.5.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

29/06 2017

0.2.4

0.2.4.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

28/06 2017

0.2.3

0.2.3.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

28/06 2017

0.2.2

0.2.2.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

28/06 2017

0.2.1

0.2.1.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

27/06 2017

0.2.0

0.2.0.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

30/10 2015

0.1.0

0.1.0.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

19/10 2015

0.0.3

0.0.3.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

12/10 2015

0.0.2

0.0.2.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat

12/10 2015

0.0.1

0.0.1.0

Yii2 wrapper for uploadcare service

  Sources   Download

MIT

The Requires

 

by Avatar sokrat