PHPackages                             black-lamp/yii2-file-icons - 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. black-lamp/yii2-file-icons

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

black-lamp/yii2-file-icons
==========================

Widget for getting the font-icon for file extension

1.0.2(9y ago)0986[1 issues](https://github.com/black-lamp/yii2-file-icons/issues)BSD-3-ClausePHPPHP &gt;=5.6.0

Since Jan 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/black-lamp/yii2-file-icons)[ Packagist](https://packagist.org/packages/black-lamp/yii2-file-icons)[ RSS](/packages/black-lamp-yii2-file-icons/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

File icons widget for Yii2
==========================

[](#file-icons-widget-for-yii2)

Widget for getting the font-icon for file extension

[![Build Status](https://camo.githubusercontent.com/0190968903bee750ea6df7e9103fbb88a141c26b04482a87dcbe3047e52fec92/68747470733a2f2f7472617669732d63692e6f72672f626c61636b2d6c616d702f796969322d66696c652d69636f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/black-lamp/yii2-file-icons)[![Latest Stable Version](https://camo.githubusercontent.com/68ceef0ccd57a2c738f69bb01d5852e034d34c6fd1d330de59add27e2bca340f/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2d6c616d702f796969322d66696c652d69636f6e732f762f737461626c65)](https://packagist.org/packages/black-lamp/yii2-file-icons)[![Latest Unstable Version](https://camo.githubusercontent.com/2992b9e4b3e1fad42c50310a5d75822477838a8ecd390222b9f91416497e1ebf/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2d6c616d702f796969322d66696c652d69636f6e732f762f756e737461626c65)](https://packagist.org/packages/black-lamp/yii2-file-icons)[![License](https://camo.githubusercontent.com/5ee3cafa10a884bebcc4fb72e87137c7cf99b6c4ce1feed6fd4ea8da50bfb8c3/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2d6c616d702f796969322d66696c652d69636f6e732f6c6963656e7365)](https://packagist.org/packages/black-lamp/yii2-file-icons)

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

[](#installation)

Run command

```
composer require black-lamp/yii2-file-icons

```

or add

```
"black-lamp/yii2-file-icons": "^1.0.0"
```

to the require section of your composer.json.

Using
-----

[](#using)

Example of using

```
$widget = \bl\files\icons\FileIconWidget::begin([
    'icons' => [
        'txt' => [
            'icon' => \yii\helpers\Html::tag('i', '', ['class' => 'icon-file-txt'])
        ],
        'groups' => [
            [
                'extensions' => ['jpg', 'png', 'gif'],
                'icon' => \yii\helpers\Html::tag('i', '', ['class' => 'icon-picture'])
            ],
        ]
    ]
]);
echo $widget->getIcon('image.jpg');
$widget->end();
```

Method `FileIconWidget::getIcon()` takes file extension, file name or full path to file and returns icon for file extension. Icon - method gets from configuration array. If icon not found in configuration array method returns empty icon. Empty icon value gets from `emptyIcon` widget option.

### Widget configuration properties

[](#widget-configuration-properties)

OptionDescriptionTypeDefaulticonsArray with configuration for file extensions and iconsarray-useDefaultIconsIf set `true` - widget will be user default icons for filesbooleanfalseemptyIconIf icon will not be found if `icons` array or in defaul icons set - value from this property will be returnedstring'Icon for this extension not found!'### Default icon set

[](#default-icon-set)

If you set widget option `useDefaultIcons` in `true` - method `FileIconWidget::getIcon()` will be returns default icons for file extensions. Also you can override default icons if you dont't wont to use default icon for curren file extension. [![Default icon set](/docs/images/icons.png "Default icon set")](/docs/images/icons.png)

```

```

or using `\bl\files\icons\helpers\IconHelper`

```
IconHelper::icon('text');
IconHelper::icon('pdf');
IconHelper::icon('power-point');
IconHelper::icon('archive');
IconHelper::icon('word');
IconHelper::icon('excel');
IconHelper::icon('picture');
IconHelper::icon('video');
IconHelper::icon('code');
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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

Every ~14 days

Total

3

Last Release

3368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e1784ec992318bf7ed40a2025a0ca035a01143de89054f0f4c9bc39469928c1?d=identicon)[GutsVadim](/maintainers/GutsVadim)

---

Top Contributors

[![greeflas](https://avatars.githubusercontent.com/u/17636915?v=4)](https://github.com/greeflas "greeflas (15 commits)")[![nojes](https://avatars.githubusercontent.com/u/17221145?v=4)](https://github.com/nojes "nojes (1 commits)")

---

Tags

black-lampphpyii-extensionyii-widgetsyii2iconsfilefilesyii2widgeticon

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/black-lamp-yii2-file-icons/health.svg)

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

###  Alternatives

[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M95](/packages/kartik-v-yii2-widget-fileinput)[vova07/yii2-fileapi-widget

The FileAPI widget for Yii2 framework.

4765.5k9](/packages/vova07-yii2-fileapi-widget)[kartik-v/yii2-editors

Editor widgets Yii2 framework. Summernote WYSIWYG editor, Codemirror code editor and PlainText editor for Bootstrap 3.x, 4.x and 5.x.

23300.9k1](/packages/kartik-v-yii2-editors)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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