FilePond Widget for Yii Framework.

dev-main 2024-04-17 10:17 UTC

This package is auto-updated.

Last update: 2024-10-17 11:20:58 UTC


README

FilePond.


php-version PHPUnit PHPUnit Codecov Infection

filepond

Installation

The preferred way to install this extension is through composer.

Either run

composer require --dev --prefer-dist yii2-extensions/filepond

or add

"yii2-extensions/filepond": "dev-main"

to the require-dev section of your composer.json file.

Usage

Name

use Yii2\Extensions\Filepond\FilePond;

echo FilePond::widget(['name' => 'image_file']);

Active Field

use Yii2\Extensions\Filepond\FilePond;

echo $form
    ->field($formModel, 'image_file')
    ->widget(
        FilePond::class,
        [
            'loadFileDefault' => $imageFile,
            'imagePreviewHeight' => 170,
            'imageCropAspectRatio' => '1:1',
        ],
    );

Controller or Model

use Yii2\Extensions\Filepond\FileProcessing;

$imageFile = FileProcessing::saveWithReturningFile(
    $categoryForm->image_file,
    Yii::getAlias('@uploads'),
    "category{$category->id}",
    false
);        

Properties of the widget

Translation support

The extension supports translation. You can translate the extension into your language, for default the extension supports the following languages:

  • Chinese
  • English
  • French
  • German
  • Poland
  • Portuguese
  • Russian
  • Spanish

Quality code

static-analysis phpstan-level StyleCI

Support versions Yii2

Yii20 Yii22

Testing

Check the documentation testing to learn about testing.

Our social networks

Twitter

License

The MIT License. Please see License File for more information.