PHPackages                             mirko-pagliai/cakephp-assets - 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. mirko-pagliai/cakephp-assets

AbandonedArchivedCakephp-plugin

mirko-pagliai/cakephp-assets
============================

Assets plugin for CakePHP

1.6.0(2y ago)352.5k↓100%1MITPHPPHP &gt;=8.1

Since Mar 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mirko-pagliai/cakephp-assets)[ Packagist](https://packagist.org/packages/mirko-pagliai/cakephp-assets)[ Docs](https://github.com/mirko-pagliai/cakephp-assets)[ RSS](/packages/mirko-pagliai-cakephp-assets/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (7)Versions (37)Used By (0)

cakephp-assets plugin
=====================

[](#cakephp-assets-plugin)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![CI](https://github.com/mirko-pagliai/cakephp-assets/actions/workflows/ci.yml/badge.svg)](https://github.com/mirko-pagliai/cakephp-assets/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/259896a6f3ebdd1160f6aef457e08818e19be61e6887ee157010622eb79e486d/68747470733a2f2f636f6465636f762e696f2f67682f6d69726b6f2d7061676c6961692f63616b657068702d6173736574732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mirko-pagliai/cakephp-assets)[![Codacy Badge](https://camo.githubusercontent.com/8bf401549c580af998d81ea1929733ebddfe2b26356875b90648e34de317cdc8/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6166663261303131313238353461653662643864353765323766333732313364)](https://www.codacy.com/gh/mirko-pagliai/cakephp-assets/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mirko-pagliai/cakephp-assets&utm_campaign=Badge_Grade)[![CodeFactor](https://camo.githubusercontent.com/d451965c3210aed08dd17a86e936e15db074f4c7dcca01009a1c39746d6f1af4/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d69726b6f2d7061676c6961692f63616b657068702d6173736574732f6261646765)](https://www.codefactor.io/repository/github/mirko-pagliai/cakephp-assets)

*cakephp-assets* is a CakePHP plugin to allows you to handle and generate assets.

It uses [matthiasmullie/minify](https://github.com/matthiasmullie/minify) and provides a convenient helper that allows you to combine multiple asset files into one single compressed file.

Did you like this plugin? Its development requires a lot of time for me. Please consider the possibility of making [a donation](https://paypal.me/mirkopagliai): even a coffee is enough! Thank you.

[![Make a donation](https://camo.githubusercontent.com/d9f2015fc776952b7d14005e3f0e18099924deeb096bffd93869762ebecde952/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f7765627374617469632f6d6b74672f6c6f676f2d63656e7465722f6c6f676f5f70617970616c5f63617274652e6a7067)](https://paypal.me/mirkopagliai)

- [Installation](#installation)
    - [Installation on older CakePHP and PHP versions](#installation-on-older-cakephp-and-php-versions)
        - [For PHP 7.2 and CakePHP 4 or later](#for-php-72-and-cakephp-4-or-later)
        - [For PHP 5.6 and CakePHP 3 or later](#for-php-56-and-cakephp-3-or-later)
- [Configuration](#configuration)
    - [Configuration values](#configuration-values)
- [How to use](#how-to-use)
- [Versioning](#versioning)

---

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

[](#installation)

You can install the plugin via composer:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-assets
```

Then you have to load the plugin. For more information on how to load the plugin, please refer to the [Cookbook](https://book.cakephp.org/4.0/en/plugins.html#loading-a-plugin).

Simply, you can execute the shell command to enable the plugin:

```
bin/cake plugin load Assets
```

This would update your application's bootstrap method.

By default, the plugin uses the `APP/tmp/assets` directory to save the asset files. So you have to create the directory and make it writable:

```
$ mkdir tmp/assets && chmod 775 tmp/assets
```

If you want to use a different directory, read the [Configuration](#configuration) section.

### Installation on older CakePHP and PHP versions

[](#installation-on-older-cakephp-and-php-versions)

Recent packages and the master branch require at least CakePHP 5.0 and PHP 8.1 and the current development of the code is based on these and later versions of CakePHP and PHP. However, there are still some branches compatible with previous versions of CakePHP and PHP.

#### For PHP 7.2 and CakePHP 4 or later

[](#for-php-72-and-cakephp-4-or-later)

The [cakephp4](//github.com/mirko-pagliai/cakephp-assets/tree/cakephp4) branch requires at least PHP `>=7.2` and CakePHP `^4.0`.

In this case, you can install the package as well:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-assets:dev-cakephp4
```

Note that the `cakephp4` branch will no longer be updated as of January 5, 2024, except for security patches, and it matches the [1.5.13](//github.com/mirko-pagliai/cakephp-assets/releases/tag/1.5.13) version.

#### For PHP 5.6 and CakePHP 3 or later

[](#for-php-56-and-cakephp-3-or-later)

The [cakephp3](https://github.com/mirko-pagliai/cakephp-assets/tree/cakephp3) branch requires at least PHP 5.6 and CakePHP 3.

In this case, you can install the package as well:

```
$ composer require --prefer-dist mirko-pagliai/cakephp-assets:dev-cakephp3
```

Note that the `cakephp3` branch will no longer be updated as of April 27, 2021, except for security patches, and it matches the [1.5.4](https://github.com/mirko-pagliai/cakephp-assets/releases/tag/1.5.4) version.

Configuration
-------------

[](#configuration)

The plugin uses some configuration parameters and you can set them using the `\Cake\Core\Configure` class, **before** loading the plugin.

For example, you can do this at the bottom of the file `APP/config/app.php`of your application.

### Configuration values

[](#configuration-values)

```
Configure::write('Assets.force', false);
```

Setting `Assets.force` to `true`, the assets will be used even if debugging is enabled.

```
Configure::write('Assets.target', TMP . 'assets');
```

Setting `Assets.target`, you can use another directory where the plugin will generate the assets.

How to use
----------

[](#how-to-use)

You have to use only the `AssetHelper`. This helper provides `css()` and `script()` methods, similar to the methods provided by the `HtmlHelper`.

The syntax is the same, you just have to change the name helper. Example for `AssetHelper::css()`.

```
echo $this->Asset->css(['one.css', 'two.css']);
```

This will combine and compress `one.css` and `two.css` files, creating a unique asset file, and will create a link element for CSS stylesheets, as does the method provided by the `HtmlHelper`.

The same also applies to the `AssetHelper::script()` method.

Refer to our [API](https://mirko-pagliai.github.io/cakephp-assets).

Versioning
----------

[](#versioning)

For transparency and insight into our release cycle and to maintain backward compatibility, *cakephp-assets* will be maintained under the [Semantic Versioning guidelines](http://semver.org).

###  Health Score

41

↑

FairBetter than 89% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 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 ~89 days

Recently: every ~154 days

Total

33

Last Release

807d ago

PHP version history (3 changes)1.0.0PHP &gt;=5.5.9

1.5.0PHP &gt;=7.2

1.6.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/56d4c91c4d1ce5952a13c723d4fd340f8a1220ba1ef0212bbdb9a6334c98b3b9?d=identicon)[mirko-pagliai](/maintainers/mirko-pagliai)

---

Top Contributors

[![mirko-pagliai](https://avatars.githubusercontent.com/u/293199?v=4)](https://github.com/mirko-pagliai "mirko-pagliai (443 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mirko-pagliai-cakephp-assets/health.svg)

```
[![Health](https://phpackages.com/badges/mirko-pagliai-cakephp-assets/health.svg)](https://phpackages.com/packages/mirko-pagliai-cakephp-assets)
```

###  Alternatives

[snelg/cakephp-3-oracle

Oracle datasource for CakePHP 3

111.5k](/packages/snelg-cakephp-3-oracle)

PHPackages © 2026

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