PHPackages                             slexx/yii2-file-kit - 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. slexx/yii2-file-kit

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

slexx/yii2-file-kit
===================

Yii2 file upload and storage kit

v1.0.0(6y ago)14BSD-3-ClauseJavaScript

Since Feb 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/slexx1234/yii2-file-kit)[ Packagist](https://packagist.org/packages/slexx/yii2-file-kit)[ RSS](/packages/slexx-yii2-file-kit/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

extension is still under heavy development ;) STORAGE
-----------------------------------------------------

[](#extension-is-still-under-heavy-development-storage)

```
'fileStorage'=>[
    'class'=>'trntv\filekit\storage\FileStorage',
    'repositories'=>[
        'uploads'=>[
            'class'=>'trntv\filekit\storage\repository\FilesystemRepository',
            'basePath'=>'@webroot/uploads',
            'baseUrl'=>'@web/uploads'
        ],
        'other-path'=>[
            'class'=>'trntv\filekit\storage\repository\FilesystemRepository',
            'basePath'=>'@webroot/other',
            'baseUrl'=>'@web/other',
            'createDbRecord'=>false
        ]
    ],
],

```

Don`t forget to apply included migration - m140805\_084737\_file\_storage\_item.php

`\Yii::$app->fileStorage->getRepository('uploads')->save(UploadedFile::getInstanceByName('image'));``\Yii::$app->fileStorage->saveAll(UploadedFile::getInstancesByName('files'));``\Yii::$app->fileStorage->save('http://external_host.com/file.pdf', 'awesome documents', 'other-path');`

WIDGET
------

[](#widget)

```
echo \trntv\filekit\widget\Upload::widget([
    'model'=>$model,
    'attribute'=>'files',
    'url'=>['upload'],
    'sortable'=>true,
    'fileuploadOptions'=>[
        'maxFileSize'=>10000000, // 10 MiB
        'maxNumberOfFiles'=>3
    ]
])

```

ACTIONS
-------

[](#actions)

```
public function actions(){
   return [
           'upload'=>[
               'class'=>'trntv\filekit\actions\UploadAction',
               'responseUrlParam'=>'file-url',
               'fileProcessing'=>function($file, $uploadAction){
                    // do something (resize, add watermark etc)
               }
           ]
       ];
   }

```

BEHAVIOR
--------

[](#behavior)

```
 public function behaviors()
 {
     return [
          'file' => [
              'class' => 'trntv\filekit\behaviors\UploadBehavior',
              'uploadAttribute' => 'file',
              'resultAttribute' => 'path',
              'fileCategory' => 'products',
              'fileRepository' => 'uploads',
              'fileProcessing'=>function($file, $uploadAction){
                  // resize etc
              }
          ],
      ];
 }
```

PATH HELPER
-----------

[](#path-helper)

```
$path = new \trntv\filekit\base\Path(['path'=>'/var/www/images/product.jpg'])
echo $path->filename; // product.jpg
$path->filename = 'service.jpg';
echo $path; // /var/www/images/service.jpg
$path->addFilenamePrefix('_thumb');
echo $path->filename; // service_thumb.jpg
echo $path; // /var/www/images/service_thumb.jpg

```

URL HELPER
----------

[](#url-helper)

```
$url = new \trntv\filekit\base\Url(['url'=>'http://example.com/1/test.php'])
echo $url->host; // example.com
echo $url->path->filename; // test.php;
$url->port = 88;
$url->path->filename = 'product.jpg';
echo $url; // http://example.com:88/1/product.jpg
$url->path->addFilenamePrefix('_thumb');
echo $url; // http://example.com:88/1/product_thumb.jpg

```

TODO
----

[](#todo)

- MongoDB Repository
- Cloud repositories

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d76b1d60ad85fc4479c1a04bf6816cbc12ff9a1c9748ff56f5771c0dac46d042?d=identicon)[slexx](/maintainers/slexx)

---

Top Contributors

[![slexx1234](https://avatars.githubusercontent.com/u/23412450?v=4)](https://github.com/slexx1234 "slexx1234 (1 commits)")

### Embed Badge

![Health badge](/badges/slexx-yii2-file-kit/health.svg)

```
[![Health](https://phpackages.com/badges/slexx-yii2-file-kit/health.svg)](https://phpackages.com/packages/slexx-yii2-file-kit)
```

###  Alternatives

[mihaildev/yii2-elfinder

Yii2 ElFinder

169658.8k52](/packages/mihaildev-yii2-elfinder)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)[devgroup/yii2-dropzone

Yii2 Dropzone widget

1051.6k1](/packages/devgroup-yii2-dropzone)[limion/yii2-jquery-fileupload-widget

Blueimp file upload widget for Yii2

1224.5k](/packages/limion-yii2-jquery-fileupload-widget)[floor12/yii2-module-files

Yii2 module to upload and manage files to your models.

1612.4k6](/packages/floor12-yii2-module-files)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
