PHPackages                             bradstinson/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. bradstinson/assets

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

bradstinson/assets
==================

A simple assets library. Combine and minify your JS and CSS assets

1.1.0(11y ago)207954MITPHPPHP &gt;=5.3.0

Since Dec 4Pushed 5y ago3 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (13)Used By (0)

Assets
======

[](#assets)

[![Build Status](https://camo.githubusercontent.com/9e284f64e05f58a57e6b14e1f0b9534eb828000a6ac6a6b5e0ff73c8cb127616/68747470733a2f2f7472617669732d63692e6f72672f627261647374696e736f6e2f6173736574732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bradstinson/assets)

Assets is yet another CSS/JavaScript minificaton and combination library. However, unlike most other libraries (which rely on Assetic), this ones takes a more simplistic approach.

Assets supports minifying and combining stylesheets and scripts, in an effort to reduce the number and size of http requests needed to load a given page. The generated file is also cached, which prevents an application from having to generate the same file for every new request.

Basic usage
-----------

[](#basic-usage)

### CSS

[](#css)

CSS files can be added using the following command, where "file1.css" and "file2.css" are the CSS files you want to include, and are located at assets/css/file1.css and assets/css/file2.css.

```
Assets::css('file1.css');
Assets::css('file2.css');
```

You may also submit files as an array.

```
Assets::css(array('file1.css', 'file2.css'));
```

Assets will minify both CSS files and combine them into a single file (which is written to 'assets/cache' directory). The proper tags will then be returned. To include this file in your page, use the following:

```
echo Assets::renderCss();
/*
Returns something like:

*/
```

### LESS

[](#less)

Less files can be added using the following command, where "file1.less" is the Less file you want to compile, and is located at assets/css/file1.less.

```
Assets::less('file1.less');
```

You may also submit multiple files as an array.

```
Assets::css(array('file1.less', 'file2.less'));
```

Your Less files will be automatically compiled and combined with your CSS files into a single file (which is written to 'assets/cache' directory). The proper tags will then be returned.

### JS

[](#js)

Javascript files can be added using the following command, where "file1.js" and "file2.js" are the javascript files you want to include, and are located at assets/js/file1.js and assets/js/file2.js.

```
Assets::js('file1.js');
Assets::js('file2.js');
```

You may also submit files as an array.

```
Assets::js(array('file1.js', 'file2.js'));
```

Assets will minify both JS files and combine them into a single file (which is written to 'assets/cache' directory). The proper tags will then be returned. To include this file in your page, use the following:

```
echo Assets::renderJs();
/*
Returns something like:

*/
```

### CoffeeScript

[](#coffeescript)

CoffeeScript files can be added using the following command, where "file1.coffee" is the CoffeeScript file you want to compile, and is located at assets/js/file1.coffee.

```
Assets::coffee('file1.coffee');
```

You may also submit multiple files as an array.

```
Assets::coffee(array('file1.coffee', 'file2.coffee'));
```

Your CoffeeScript files will be automatically compiled and combined with your JS files into a single file (which is written to 'assets/cache' directory). The proper tags will then be returned.

If you would like to generate the CSS and JS tags together, you can call:

```
echo Assets::render();
/*
Which will return:

*/
```

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

[](#configuration)

By default, this library assumes the following directory structure:

```
assets/
   css/
   js/
   cache/

```

However, you are now able to adjust the path to the assets directory (if needed):

```
Assets::setPath('public/assets/');
```

### BaseURL

[](#baseurl)

```
Assets::setBaseurl('/');
```

Groups
------

[](#groups)

This library currently does not offer support for groups. This is because the project I was working on did not require it. If enough requests are made, this may be added in a future version.

Thanks
------

[](#thanks)

This asset library was inspired by and uses components from the following libraries:

- [Assets](https://github.com/bstrahija/assets)
- [Assetic](https://github.com/kriswallsmith/assetic)
- [Basset](https://github.com/jasonlewis/basset)
- [CssMin](https://github.com/natxet/CssMin)
- [LessPHP](https://github.com/leafo/lessphp)
- [CoffeeScript PHP](https://github.com/alxlit/coffeescript-php)

Contributing
------------

[](#contributing)

If you have any issues/complaints/suggestions, let me know and I will see if I can implement them as time permits. Also, pull requests are also welcome.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~73 days

Recently: every ~162 days

Total

11

Last Release

4178d ago

Major Versions

0.0.0 → 1.0.02013-03-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/3374e401d17b6c8274b943c9d05a4b23a8b343f3010acb5fc26762f42b224541?d=identicon)[bradstinson](/maintainers/bradstinson)

---

Top Contributors

[![bradstinson](https://avatars.githubusercontent.com/u/1078917?v=4)](https://github.com/bradstinson "bradstinson (55 commits)")[![SerafimArts](https://avatars.githubusercontent.com/u/2461257?v=4)](https://github.com/SerafimArts "SerafimArts (1 commits)")

---

Tags

cssJSminifyassets

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/bradstinson-assets/health.svg)](https://phpackages.com/packages/bradstinson-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)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[sensiolabs/minify-bundle

Assets Minifier (CSS, JS) for Symfony &amp; Minify integration in Asset Mapper

5694.9k1](/packages/sensiolabs-minify-bundle)[jalle19/php-yui-compressor

A modern PHP wrapper for the YUI compressor

17972.2k3](/packages/jalle19-php-yui-compressor)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.3k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

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