PHPackages                             passchn/cakephp-file-pool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. passchn/cakephp-file-pool

ActiveCakephp-plugin[File &amp; Storage](/categories/file-storage)

passchn/cakephp-file-pool
=========================

FilePool plugin for CakePHP

v0.3.4(5mo ago)052MITPHPPHP &gt;=8.2

Since Oct 28Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/passchn/cakephp-file-pool)[ Packagist](https://packagist.org/packages/passchn/cakephp-file-pool)[ RSS](/packages/passchn-cakephp-file-pool/feed)WikiDiscussions cake5 Synced 3d ago

READMEChangelog (9)Dependencies (4)Versions (13)Used By (0)

FilePool plugin for CakePHP 5
=============================

[](#filepool-plugin-for-cakephp-5)

Gives you a fast and simple way to add files to entities.

Note

This is an extension to the [passchn/cakephp-assets](https://packagist.org/packages/passchn/cakephp-assets) plugin.

**Features:**

- No-config FilePool widget (through a ViewHelper) for any Entity you have
- Possibility to upload, sort, edit or delete files from within the widget
- Drag and drop functionality to upload multiple files
- You can easily control if a visitor can upload, edit or delete items
- Translations in english and german

Prerequisites
-------------

[](#prerequisites)

Follow the installation guide for [passchn/cakephp-assets](https://packagist.org/packages/passchn/cakephp-assets)and make sure the plugin is working in your app.

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require passchn/cakephp-file-pool
```

Then, load the plugin:

```
bin/cake plugin load FilePool
```

Load the helper in your `AppView.php`:

```
$this->loadHelper('FilePool.FilePool');
```

Run the migrations

```
bin/cake migrations migrate --plugin FilePool
```

... or copy the migration to your App's migration files.

Usage
-----

[](#usage)

Use the `FilePool` helper for any Entity in a template:

```

```

### Define relations

[](#define-relations)

You can easily define Relations to the entity in your `ExamplesTable`:

```
$this->hasMany('Downloads', ['foreignKey' => 'owner_id'])
    ->setConditions(['owner_source' => 'Examples'])
    ->setClassName('FilePool.FilePoolAssets');
```

… and then access the files through `$example->downloads` after containing `Downloads.Assets` in your Controller.

Troubleshooting
---------------

[](#troubleshooting)

### Widget is not rendering

[](#widget-is-not-rendering)

If the widget does not show up, make sure you are fetching scripts somewhere in your template:

```
