PHPackages                             devlabs91/cssurlrewrite-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. devlabs91/cssurlrewrite-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

devlabs91/cssurlrewrite-bundle
==============================

A small assetic filter for symfony to fix all url paths at css documents to correct urls

v1.0.8(6y ago)02.7kMITPHPPHP &gt;=5.3.2

Since Jan 4Pushed 6y agoCompare

[ Source](https://github.com/devlabs91/FkrCssURLRewriteBundle)[ Packagist](https://packagist.org/packages/devlabs91/cssurlrewrite-bundle)[ Docs](https://github.com/fkrauthan/FkrCssURLRewriteBundle)[ RSS](/packages/devlabs91-cssurlrewrite-bundle/feed)WikiDiscussions 1.0 Synced 3d ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

FkrCssURLRewriteBundle
======================

[](#fkrcssurlrewritebundle)

A small assetic filter for Symfony2 to fix all url paths in css documents to correct urls. It also provides easy resource linking across platforms.

Installation
============

[](#installation)

Bring in the vendor libraries
-----------------------------

[](#bring-in-the-vendor-libraries)

This can be done in three different ways:

**Method #1**) Use composer

```
"require": {
    "fkr/cssurlrewrite-bundle": "*"
}
```

**Method #2**) Use git submodules

```
git submodule add git://github.com/fkrauthan/FkrCssURLRewriteBundle.git vendor/bundles/Fkr/CssURLRewriteBundle

```

**Method #3**) Use deps file

```
[FkrCssURLRewriteBundle]
    git=git://github.com/fkrauthan/FkrCssURLRewriteBundle.git
	target=bundles/Fkr/CssURLRewriteBundle

```

Register the Fkr namespaces
---------------------------

[](#register-the-fkr-namespaces)

If not using composer, register the `Fkr` namespace with Symfony's autoloader:

```
// app/autoload.php
$loader->registerNamespaces(array(
    'Fkr' => __DIR__.'/../vendor/bundles',
    // your other namespaces
));
```

Add CssURLRewriteBundle to your application kernel
--------------------------------------------------

[](#add-cssurlrewritebundle-to-your-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Fkr\CssURLRewriteBundle\FkrCssURLRewriteBundle(),
        // ...
    );
}
```

Configuration
=============

[](#configuration)

```
# app/config.yml
fkr_css_url_rewrite:
    rewrite_only_if_file_exists: true
    clear_urls: true
```

- rewrite\_only\_if\_file\_exists: If true (default) only rewrites url if the resource exists in the .../BundleFolder/Resources/public/ folder.
- clear\_urls: If true (default) the generated url gets normalized. For example if the url normaly is `.../less/../img` this option makes `.../img`.

Usage
=====

[](#usage)

**Standard usage**

If you place your css file for example in

```
.../BundleFolder/Resources/public/css

```

and you have your images in

```
../BundleFolder/Resources/public/img

```

then you have in yours css file somthing like this

```
background-image: url(../img/MyImageName.png)
```

Now you have to call

```
app/console assets:install

```

Now if you have somthing like this in your template

```
{% stylesheets filter='css_url_rewrite,?yui_css'
	'@BundleName/Resources/public/css/mycssfile.css'
%}

{% endstylesheets %}

```

Now the filter rewrites your url in your css file

```
background-image: url(../img/MyImageName.png) => background-image: url(../bundles/bundlename/css/../img/MyImageName.png)

```

And everything works fine.

**Extended usage**

You can link images from other bundles by using the @ annotation. For example if you write this in you css file

```
background-image: url(@BundleNameBundle/img/MyImageName.png)

```

Now the filter rewrite this url in your css file

```
background-image: url(@BundleNameBundle/img/MyImageName.png) => background-image: url(../bundles/bundlename/img/MyImageName.png)

```

License
=======

[](#license)

[Resources/meta/LICENSE](https://github.com/fkrauthan/FkrCssURLRewriteBundle/blob/master/Resources/meta/LICENSE)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75.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

Every ~288 days

Recently: every ~100 days

Total

10

Last Release

2282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/208889df303d890cbed907941b6072f44091ef330ae1cde02942915cb063d1b0?d=identicon)[devlabs91](/maintainers/devlabs91)

---

Top Contributors

[![fkrauthan](https://avatars.githubusercontent.com/u/1679841?v=4)](https://github.com/fkrauthan "fkrauthan (37 commits)")[![andya901](https://avatars.githubusercontent.com/u/45679438?v=4)](https://github.com/andya901 "andya901 (4 commits)")[![marekkalnik](https://avatars.githubusercontent.com/u/548629?v=4)](https://github.com/marekkalnik "marekkalnik (3 commits)")[![johnkary](https://avatars.githubusercontent.com/u/135607?v=4)](https://github.com/johnkary "johnkary (1 commits)")[![rejinka](https://avatars.githubusercontent.com/u/831348?v=4)](https://github.com/rejinka "rejinka (1 commits)")[![valqk](https://avatars.githubusercontent.com/u/1799031?v=4)](https://github.com/valqk "valqk (1 commits)")[![c33s](https://avatars.githubusercontent.com/u/649209?v=4)](https://github.com/c33s "c33s (1 commits)")[![jmather](https://avatars.githubusercontent.com/u/450978?v=4)](https://github.com/jmather "jmather (1 commits)")

---

Tags

cssasseticassetrewriteSymfony Bundlecss urlcssrewrite

### Embed Badge

![Health badge](/badges/devlabs91-cssurlrewrite-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/devlabs91-cssurlrewrite-bundle/health.svg)](https://phpackages.com/packages/devlabs91-cssurlrewrite-bundle)
```

###  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)[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[wikimedia/less.php

PHP port of the LESS processor

12327.4M77](/packages/wikimedia-lessphp)[dotsunited/bundlefu

BundleFu is a PHP 5.3+ library which bundles multiple css/javascript files into a big package and sends it out at once

7028.5k3](/packages/dotsunited-bundlefu)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)

PHPackages © 2026

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