PHPackages                             tripomatic/nette-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. [Framework](/categories/framework)
4. /
5. tripomatic/nette-assetic

ActiveLibrary[Framework](/categories/framework)

tripomatic/nette-assetic
========================

Assetic for Nette Framework

v0.1.0(9y ago)67.6k2[1 issues](https://github.com/tripomatic/nette-assetic/issues)MITPHPPHP &gt;=5.4.0

Since Jul 12Pushed 6y ago10 watchersCompare

[ Source](https://github.com/tripomatic/nette-assetic)[ Packagist](https://packagist.org/packages/tripomatic/nette-assetic)[ Docs](https://github.com/tripomatic/nette-assetic)[ RSS](/packages/tripomatic-nette-assetic/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Tripomatic\\NetteAssetic
========================

[](#tripomaticnetteassetic)

A lightweight [Assetic](https://github.com/kriswallsmith/assetic) integration in [Nette Framework](http://nette.org).

Tripomatic\\NetteApi integrates Assetic in Nette Framework in a minimalist way that allows using Assetic features without limitations. Configuration is fully compatible with the official Assetic package - no additional unnecessary conventions are introduced. Tripomatic\\NetteApi also integrates asset routing for development environments and provides commands for asset dumping during production deployment.

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

[](#installation)

Install Tripomatic\\NetteAssetic using [Composer](https://getcomposer.org):

```
$ composer require tripomatic/nette-assetic
```

Quickstart
----------

[](#quickstart)

Add NetteAssetic extension in your [NEON config](http://doc.nette.org/en/2.3/configuring):

```
extensions:
  	assetic: Tripomatic\NetteAssetic\DI\AsseticExtension
```

Configure assets in corresponding extension's section:

```
assetic:
	assets:
		cssLibs:
			files:
				- %appDir%/../vendor/bower-assets/bootstrap/dist/css/bootstrap.min.css
				- %appDir%/../vendor/bower-assets/bootstrap-select/dist/css/bootstrap-select.min.css

		cssDefault:
			files:
				- %appDir%/../document_root/css/main.css

		jsLibs:
			files:
				- %appDir%/../document_root/bower-assets/jquery/dist/jquery.js
				- %appDir%/../document_root/bower-assets/bootstrap/dist/js/bootstrap.js

		jsDefault:
			files:
				- %appDir%/../document_root/js/main.js
```

Include assets in your [Latte](http://latte.nette.org) template:

```

```

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

[](#configuration)

Tripomatic\\NetteAssetic provides easy and transparent configuration which is compatible with [Assetic](https://github.com/kriswallsmith/assetic)'s settings.

### Debug mode

[](#debug-mode)

Debug mode is set up automatically according to your application's `debugMode`. This behavior can be overriden:

```
assetic:
	debug: TRUE # or FALSE to disable debug mode
```

### Asset routing

[](#asset-routing)

In debug mode assets are automatically compiled and served to the ouptut with [`AssetRoute`](src/Application/AssetRoute.php). This behavior can be overriden:

```
assetic:
	route: TRUE # or FALSE to disable asset routing
```

### Filters

[](#filters)

[Assetic filters](https://github.com/kriswallsmith/assetic#filters) are fully supported. At first filters must be registered in a similar way as common services:

```
assetic:
	filters:
		lessPhp: Assetic\Filter\LessphpFilter
		yuiCss: Assetic\Filter\Yui\CssCompressorFilter('/path/to/yuicompressor.jar')
```

Then they can be assigned to assets:

```
assetic:
	assets:
		assetName:
			files:
				- %appDir%/../document_root/css/front.less
				- %appDir%/../document_root/css/admin.less
			filters:
				- lessPhp
				- ?yuiCss
```

Prefixing a filter name with `?` cause the filter to be omitted in debug mode.

### Workers

[](#workers)

[Assetic workers](https://github.com/kriswallsmith/assetic/blob/master/src/Assetic/Factory/Worker/WorkerInterface.php) are fully supported. All assets will be passed to the worker's `process()` method. Typical example is the [CacheBustingWorker](https://github.com/kriswallsmith/assetic#cache-busting):

```
assetic:
	workers:
		- Assetic\Factory\Worker\CacheBustingWorker
```

### Cache

[](#cache)

Asset compiling and serving can be computationally expensive. Therefore, assets are cached and recompiled only when changed. By default assets are cached only in-memory with `Assetic\Cache\ArrayCache`. It's better to use a persistent cache that can keep data between two requests:

```
assetic:
	cache: Assetic\Cache\FilesystemCache(%tempDir%/assetic)
```

For a full list of cache implementations see .

[`AssetRoute`](src/Application/AssetRoute.php) also automatically handles HTTP caching by using the correct cache-control headers. If an asset has not been modified the client receives `HTTP/1.1 304 Not Modified`.

### Asset dumping

[](#asset-dumping)

Although content and HTTP caching mechanisms can significantly speed up asset serving, there is still an overhead of running the application for every asset. Thus in production environments the assets should be dumped to a filesystem or CDN during deploy and served directly by HTTP server or CDN network.

The easiest option to dump all assets to their target location is using provided [`Symfony\Console`](https://github.com/symfony/Console) command. NetteAssetic automatically registers the command in DI container so all that has to be done is to register the command to your console application instance:

```
$commands = $container->findByType('Symfony\Component\Console\Command\Command');
foreach ($commands as $commandName) {
	$consoleApplication->add($container->getService($commandName));
}
```

Then the assets can be dumped with (supposing you run the Symfony\\Console application from `console.php`):

```
$ php console.php assetic:dump
```

Don't forget to add the above line to your deploy scripts.

### List of configuration options

[](#list-of-configuration-options)

Listed below are all possible configuration options along with some example values:

```
assetic:
	root: %wwwDir%
	output: assetic/*
	debug: %debugMode%
	route: TRUE
	cache: Assetic\Cache\FilesystemCache(%tempDir%/assetic)
	filters:
		lessPhp: Assetic\Filter\LessphpFilter
		yuiCss: Assetic\Filter\Yui\CssCompressorFilter('/path/to/yuicompressor.jar')
	workers:
		- Assetic\Factory\Worker\CacheBustingWorker
	assets:
		assetName:
			files:
				- %appDir%/../document_root/css/front.less
				- %appDir%/../document_root/css/admin.less
			filters:
				- lessPhp
				- ?yuiCss
			output: assetic/*
			root: %wwwDir%
			debug: TRUE
			variables: []
```

FAQ
---

[](#faq)

#### How do I include Bootstrap fonts or images?

[](#how-do-i-include-bootstrap-fonts-or-images)

For now you have to list them as assets with fixed output (Assetic itself doesn't have a better option for this):

```
assetic:
	assets:
		bootstrap_glyphicons_eot: [ files: %appDir%/../vendor/bower-assets/bootstrap/dist/fonts/glyphicons-halflings-regular.eot, output: fonts/glyphicons-halflings-regular.eot ]
		bootstrap_glyphicons_svg: [ files: %appDir%/../vendor/bower-assets/bootstrap/dist/fonts/glyphicons-halflings-regular.svg, output: fonts/glyphicons-halflings-regular.svg ]
		bootstrap_glyphicons_ttf: [ files: %appDir%/../vendor/bower-assets/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf, output: fonts/glyphicons-halflings-regular.ttf ]
		bootstrap_glyphicons_woff: [ files: %appDir%/../vendor/bower-assets/bootstrap/dist/fonts/glyphicons-halflings-regular.woff, output: fonts/glyphicons-halflings-regular.woff ]
		bootstrap_glyphicons_woff2: [ files: %appDir%/../vendor/bower-assets/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2, output: fonts/glyphicons-halflings-regular.woff2 ]
```

License
-------

[](#license)

Tripomatic\\NetteAssetic is licensed under [MIT](LICENSE.md).

###  Health Score

29

—

LowBetter than 58% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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

3619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89b00846b968f3a65171e5c8b752e6eaddae71c0e7ee070ed90a6636d66038e2?d=identicon)[JanJakes](/maintainers/JanJakes)

---

Top Contributors

[![JanJakes](https://avatars.githubusercontent.com/u/141436?v=4)](https://github.com/JanJakes "JanJakes (5 commits)")[![hrach](https://avatars.githubusercontent.com/u/284263?v=4)](https://github.com/hrach "hrach (3 commits)")

---

Tags

netteassetic

### Embed Badge

![Health badge](/badges/tripomatic-nette-assetic/health.svg)

```
[![Health](https://phpackages.com/badges/tripomatic-nette-assetic/health.svg)](https://phpackages.com/packages/tripomatic-nette-assetic)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[nette/web-project

Nette: Standard Web Project

10992.8k](/packages/nette-web-project)

PHPackages © 2026

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