# Plugin

> Represents the FilePond plugins supported by the widget.

[API reference](/docs/api/index.md) › [FilePond](/docs/extensions/filepond/reference/index.md) › [asset](/docs/extensions/filepond/reference/asset/index.md) › Plugin

| enum | `yii2\extensions\filepond\asset\Plugin` |
| --- | --- |
| Backed by | `string` |
| Source | [`src/asset/Plugin.php`](https://github.com/yii2-extensions/filepond/blob/main/src/asset/Plugin.php#L33) |

Represents the FilePond plugins supported by the widget.

The case value is the global JavaScript identifier under which the plugin registers itself, as expected by
`FilePond.registerPlugin()`.

See also: <https://pqina.nl/filepond/docs/api/plugins/>.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-FILE_ENCODE"></span>`FILE_ENCODE` | `'FilePondPluginFileEncode'` | File Encode plugin, enabled by `allowFileEncode`: submits files as base64 JSON payloads. |
| <span id="case-FILE_POSTER"></span>`FILE_POSTER` | `'FilePondPluginFilePoster'` | File Poster plugin, enabled by `allowFilePoster`: renders `metadata.poster` images inside items. |
| <span id="case-FILE_RENAME"></span>`FILE_RENAME` | `'FilePondPluginFileRename'` | File Rename plugin, enabled by `allowFileRename`: renames files through `fileRenameFunction`. |
| <span id="case-FILE_VALIDATE_SIZE"></span>`FILE_VALIDATE_SIZE` | `'FilePondPluginFileValidateSize'` | File Validate Size plugin, enabled by `allowFileSizeValidation`: validates file sizes on the client. |
| <span id="case-FILE_VALIDATE_TYPE"></span>`FILE_VALIDATE_TYPE` | `'FilePondPluginFileValidateType'` | File Validate Type plugin, enabled by `allowFileTypeValidation`: validates file types on the client. |
| <span id="case-IMAGE_CROP"></span>`IMAGE_CROP` | `'FilePondPluginImageCrop'` | Image Crop plugin, enabled by `allowImageCrop`: crops previews to `imageCropAspectRatio`. |
| <span id="case-IMAGE_EDIT"></span>`IMAGE_EDIT` | `'FilePondPluginImageEdit'` | Image Edit plugin, enabled by `allowImageEdit`: opens the Cropper.js editor. |
| <span id="case-IMAGE_EXIF_ORIENTATION"></span>`IMAGE_EXIF_ORIENTATION` | `'FilePondPluginImageExifOrientation'` | Image EXIF Orientation plugin, enabled by `allowImageExifOrientation`: corrects orientation from EXIF data. |
| <span id="case-IMAGE_PREVIEW"></span>`IMAGE_PREVIEW` | `'FilePondPluginImagePreview'` | Image Preview plugin, enabled by `allowImagePreview`: renders image previews. |
| <span id="case-IMAGE_TRANSFORM"></span>`IMAGE_TRANSFORM` | `'FilePondPluginImageTransform'` | Image Transform plugin, enabled by `allowImageTransform`: applies crop, resize, and output transforms before submission. |
| <span id="case-PDF_PREVIEW"></span>`PDF_PREVIEW` | `'FilePondPluginPdfPreview'` | PDF Preview plugin, enabled by `allowPdfPreview`: renders PDF previews. |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`assetClass()`](#method-assetClass) | Returns the asset bundle class that delivers the plugin files. | `Plugin` |
| [`hasStyles()`](#method-hasStyles) | Returns whether the plugin ships a stylesheet in its distribution. | `Plugin` |
| [`option()`](#method-option) | Returns the FilePond option that enables or disables the plugin. | `Plugin` |
| [`package()`](#method-package) | Returns the npm package name of the plugin. | `Plugin` |

## Method details

### assetClass() <span id="method-assetClass"></span>

```php
public function assetClass(): class-string<yii2\extensions\filepond\asset\AbstractPluginAsset>
```

Returns the asset bundle class that delivers the plugin files.

**Returns**

`class-string<`[`AbstractPluginAsset`](/docs/extensions/filepond/reference/asset/abstractpluginasset/index.md)`>`: Asset bundle class for the plugin.

### hasStyles() <span id="method-hasStyles"></span>

```php
public function hasStyles(): bool
```

Returns whether the plugin ships a stylesheet in its distribution.

**Returns**

`bool`: `true` when the plugin distribution includes a CSS file.

### option() <span id="method-option"></span>

```php
public function option(): string
```

Returns the FilePond option that enables or disables the plugin.

**Returns**

`string`: FilePond boolean option name.

### package() <span id="method-package"></span>

```php
public function package(): string
```

Returns the npm package name of the plugin.

**Returns**

`string`: Npm package name.