PHPackages                             nitronet/fwk-assetic - 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. nitronet/fwk-assetic

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

nitronet/fwk-assetic
====================

039PHP

Since Jan 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nitronet/fwk-assetic)[ Packagist](https://packagist.org/packages/nitronet/fwk-assetic)[ RSS](/packages/nitronet-fwk-assetic/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

fwk-assetic
===========

[](#fwk-assetic)

Adds [Assetic](https://github.com/kriswallsmith/assetic) to [Fwk\\Core](https://github.com/fwk/Core) Applications.

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

[](#installation)

### 1: Install the sources

[](#1-install-the-sources)

Via [Composer](http://getcomposer.org):

```
{
    "require": {
        "nitronet/fwk-assetic": "dev-master",
    }
}

```

If you don't use Composer, you can still [download](https://github.com/nitronet/fwk-assetic/zipball/master) this repository and add it to your `include_path` [PSR-0 compatible](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)

### 2: Configure Assetic as a Service

[](#2-configure-assetic-as-a-service)

Configures Assetic classes in your [Di](https://github.com/fwk/Di) Container, and tweak it the way you want. To make it customizable, we'll also use some INI properties:

```
[services]
; :packageDir is the directory where your service.xml is.
assetic.assets.directory = :packageDir/MyApp/templates/assets
assetic.debug = true
assetic.action.name = Asset
```

services.xml:

```

    :assetic.assets.directory
    :assetic.debug

        @assetic.FilterManager

    @assetic.AssetFactory

    assetic
    url
    :assetic.debug
    :assetic.action.name

```

Next, you want to add the ViewHelper to your ViewHelperService:

```

        asset
        @_vh.AsseticViewHelper

```

### 3: Register action and routes to the Asset Action

[](#3-register-action-and-routes-to-the-asset-action)

fwk.xml:

```

```

If you use the UrlRewriterService, you can also customize the action route:

```

```

### 4: That's it!

[](#4-thats-it)

You can now use the viewHelper in your templates, like so:

```
