PHPackages                             aura/asset-bundle - 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. aura/asset-bundle

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

aura/asset-bundle
=================

Asset management for aura v2

2.1.0(11y ago)619931BSD-2-ClausePHP

Since Nov 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/friendsofaura/Aura.Asset_Bundle)[ Packagist](https://packagist.org/packages/aura/asset-bundle)[ RSS](/packages/aura-asset-bundle/feed)WikiDiscussions master Synced 3w ago

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

Aura.Asset\_Bundle
==================

[](#auraasset_bundle)

Asset management for PHP.

Foreword
--------

[](#foreword)

### Requirements

[](#requirements)

This package requires PHP 5.3 or later. Unlike Aura library packages, this asset package has userland dependencies:

- [aura/web](https://packagist.org/packages/aura/web)

### Installation

[](#installation)

This asset-bundle is installable and autoloadable via Composer with the following `require` element in your `composer.json` file:

```
"require": {
    "aura/asset-bundle": "2.*"
}

```

### Tests

[](#tests)

[![Build Status](https://camo.githubusercontent.com/111f2766b269024ff70a8bf795f9e1ca70718f443660b15c95739cbd0c577731/68747470733a2f2f7472617669732d63692e6f72672f686172696b742f417572612e41737365745f42756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/harikt/Aura.Asset_Bundle)

```
composer install
phpunit -c tests/unit
```

### PSR Compliance

[](#psr-compliance)

This kernel attempts to comply with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

### Community

[](#community)

To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our [Google Group](http://groups.google.com/group/auraphp), follow [@auraphp on Twitter](http://twitter.com/auraphp), or chat with us on #auraphp on Freenode.

Structure of Package
--------------------

[](#structure-of-package)

Assume you have a `Vendor.Package`. All your assets should be in the `web` folder. The folder names `css`, `images`, `js` can be according to your preffered name.

```
├── src
│   ├── Cli
│   └── Web
├── tests
└── web
    ├── css
    │   └── some.css
    ├── images
    │   ├── another.jpg
    │   └── some.png
    └── js
        └── hello.js
```

Assuming you have the same structure, now in your template you can point to `/asset/vendor/package/css/some.css`, `/asset/vendor/package/js/hello.js`, `/asset/vendor/package/images/another.jpg`.

Onething you still need to make sure in the name `asset/vendor/package`

> `vendor/package` which is the composer package name.

Usage in any project
--------------------

[](#usage-in-any-project)

Add path to the router, according to the router you are using so that vendor, package and file name can be extracted from it.

An example of usage with Aura.Router and Aura.Dispatcher is given below. The dispacther is used for it need to recursively call the `__invoke` method. Else action will return responder, then you need to invoke responder to get the response and finally do send the response.

```
