PHPackages                             codenom/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. codenom/assets

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codenom/assets
==============

Asset publishing and loading for CodeIgniter 4

1.0(5y ago)131MITPHPPHP &gt;=7.2

Since Jul 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/codenomdev/codeigniter4-assets)[ Packagist](https://packagist.org/packages/codenom/assets)[ Docs](https://github.com/codenomdev/codeigniter4-assets)[ RSS](/packages/codenom-assets/feed)WikiDiscussions master Synced 1mo ago

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

codeigniter4-assets
===================

[](#codeigniter4-assets)

Asset publishing and loading for CodeIgniter 4

Quick Start
-----------

[](#quick-start)

1. Install with Composer: `> composer require codenom/assets`
2. Put CSS &amp; JS files in: **public/assets**
3. Add additional assets to config: **app/Config/Assets.php**
4. Add in head tag: ``
5. Add to footer: ``

Features
--------

[](#features)

Provides out-of-the-box asset loading for CSS and JavaScript files for CodeIgniter 4

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

[](#installation)

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

- `> composer require codenom/assets`

Or, install manually by downloading the source files and adding the directory to `app/Config/Autoload.php`.

Configuration (optional)
------------------------

[](#configuration-optional)

The library's default behavior can be overridden or augment by its config file. Copy **examples/Assets.php** to **app/Config/Assets.php** and follow the instructions in the comments. If no config file is found the library will use its defaults.

Usage
-----

[](#usage)

If installed correctly CodeIgniter 4 will detect and autoload the library, service, and config. Use the library methods `css()` and `js()` to display tags for the route-specific assets: ``

Structure
---------

[](#structure)

The library searches the assets directory (default: **public/assets**) for files matching the current route, loading them in a cascading fashion for each route segment.

**Example:**

The library will first load any root assets (`public/assets/*.css *.js`), then assets in the "users" subfolder (`public/assets/users/`), then "view" subfolder, then "12" subfolder. Any missing or invalid folders are ignored.

Additional assets may be specified from the config variable `$routes` - this is particularly helpful for including pre-bundled libraries. `$routes` maps each route to an asset file or a directory of assets to load for that route.

**Example:**

```
public $routes = [
	'' => [
		'bootstrap/dist/css/bootstrap.min.css',
		'bootstrap/dist/js/bootstrap.bundle.min.js'
	],
	'files/upload' => [
		'vendor/dropzone'
	]
];

```

This tells the library to load the Bootstrap assets for every route (`''`) without having to move it from its pre-bundled subdirectory. It also will load any assets in the `dropzone`directory for the specified route.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

2120d ago

### Community

Maintainers

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

---

Top Contributors

[![codenomdev](https://avatars.githubusercontent.com/u/47415105?v=4)](https://github.com/codenomdev "codenomdev (6 commits)")

---

Tags

javascriptcssloadercodeigniterassetscodeigniter4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codenom-assets/health.svg)

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

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[tatter/assets

Asset publishing and loading for CodeIgniter 4

4964.8k4](/packages/tatter-assets)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[tatter/frontend

Opinionated suite of frontend tech for CodeIgniter 4

125.3k](/packages/tatter-frontend)[tatter/themes

Lightweight theme manager for CodeIgniter 4

1710.2k2](/packages/tatter-themes)

PHPackages © 2026

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