PHPackages                             awilum/craft-nice - 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. [Templating &amp; Views](/categories/templating)
4. /
5. awilum/craft-nice

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

awilum/craft-nice
=================

A nice plugin with nice functions for nice data representation in Craft CMS

1.1.0(3y ago)65MITPHP

Since Nov 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Awilum/craft-nice)[ Packagist](https://packagist.org/packages/awilum/craft-nice)[ Fund](https://awilum.github.io/donate/)[ RSS](/packages/awilum-craft-nice/feed)WikiDiscussions 1.x Synced 1mo ago

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

Nice plugin for [Craft CMS](https://github.com/craftcms)
========================================================

[](#nice-plugin-for-craft-cms)

[![License MIT](https://camo.githubusercontent.com/17330ae6dd024e9e53cb81394db7208fe224d218d58ffe321564ca52a38e0a92/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f6c6162656c3d4c6963656e7365)](https://camo.githubusercontent.com/17330ae6dd024e9e53cb81394db7208fe224d218d58ffe321564ca52a38e0a92/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f6c6162656c3d4c6963656e7365) [![GitHub Repo stars](https://camo.githubusercontent.com/e3d672c0cbd077fdb79b25f7d2d68cae9b4c5ced58771d749fe5e767dc058c3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6177696c756d2f63726166742d6e6963653f6c6162656c3d5374617273)](https://camo.githubusercontent.com/e3d672c0cbd077fdb79b25f7d2d68cae9b4c5ced58771d749fe5e767dc058c3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6177696c756d2f63726166742d6e6963653f6c6162656c3d5374617273) [![GitHub forks](https://camo.githubusercontent.com/451eafe620283ee0e36a912fef51d2f268ff9c0e9c951b39c6bd469474df7370/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6177696c756d2f63726166742d6e6963653f6c6162656c3d466f726b73)](https://camo.githubusercontent.com/451eafe620283ee0e36a912fef51d2f268ff9c0e9c951b39c6bd469474df7370/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6177696c756d2f63726166742d6e6963653f6c6162656c3d466f726b73) [![Hits of Code](https://camo.githubusercontent.com/9d83680b475e62c2064fc9f055ee98ba52d18bbe08b4119416385845257b9969/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f6177696c756d2f63726166742d6e6963653f6272616e63683d312e78)](https://hitsofcode.com)

A nice plugin with nice functions for nice data representation in Craft CMS.

Requirements
------------

[](#requirements)

- **Craft CMS**: ^4.0
- **PHP**: ^8.0

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
    cd /path/to/project

    ```
2. In your terminal run `composer require awilum/craft-nice`.
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Nice.

### Usage

[](#usage)

Display nice file size in the twig tempalates:

```
//=> 1 MB
{{ niceFileSize(1000000) }}

//=> 976.56 KiB
{{ niceFileSize(1000000, false) }}

//=> 1 MB
{{ 1000000 | niceFileSize }}

//=> 976.56 KiB
{{ 1000000 | niceFileSize(false) }}

```

Display nice number in the twig tempalates:

```
//=> 10,050,050
{{ niceNumber(10050050) }}

//=> 10,050,050.00
{{ niceNumber(10050050, 2) }}

//=> 10,050,050/00
{{ niceNumber(10050050, 2, '/') }}

//=> 10:050:050/00
{{ niceNumber(10050050, 2, '/', ':') }}

//=> 10,050,050
{{ 10050050 | niceNumber() }}

//=> 10,050,050.00
{{ 10050050 | niceNumber(2) }}

//=> 10,050,050/00
{{ 10050050 | niceNumber(2, '/') }}

//=> 10:050:050/00
{{ 10050050 | niceNumber(2, '/', ':') }}

```

Display nice date time in the twig tempalates:

```
//=> November 23, 2022, 4:24 am
{{ niceDateTime(1669177469) }}

//=> November 23, 2022, 4:24 am
{{ 1669177469 | niceDateTime }}

```

Display nice file name in the twig tempalates:

```
//=> foo-bar
{{ niceFileName('foo bar') }}

//=> foo-bar
{{ 'foo bar' | niceFileName }}

```

Use Nice `niceDateTime` function in the PHP:

```
use function Awilum\CraftNice\niceDateTime;

echo niceDateTime(1669177469);
```

LICENSE
-------

[](#license)

[The MIT License (MIT)](https://github.com/awilum/craft-nice/blob/master/LICENSE.md)Copyright (c) [Sergey Romanenko](https://awilum.github.io/)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Every ~11 days

Total

3

Last Release

1244d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/477114?v=4)[Sergey Romanenko](/maintainers/Awilum)[@Awilum](https://github.com/Awilum)

---

Top Contributors

[![Awilum](https://avatars.githubusercontent.com/u/477114?v=4)](https://github.com/Awilum "Awilum (7 commits)")

---

Tags

twigCraftcraftcmscraft-plugin

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/awilum-craft-nice/health.svg)

```
[![Health](https://phpackages.com/badges/awilum-craft-nice/health.svg)](https://phpackages.com/packages/awilum-craft-nice)
```

###  Alternatives

[wbrowar/guide

A CMS Guide for Craft CMS.

6154.5k1](/packages/wbrowar-guide)[jalendport/craft-preparse

A fieldtype that parses Twig when an element is saved and saves the result as plain text.

1086.4k](/packages/jalendport-craft-preparse)[viget/craft-classnames

Classnames plugin for Craft CMS

1115.5k1](/packages/viget-craft-classnames)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.3k](/packages/verbb-footnotes)

PHPackages © 2026

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