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

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

fkr/cssurlrewrite-bundle
========================

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

v1.0.4(9y ago)37205.4k↑46.7%152MITPHPPHP &gt;=5.3.2

Since Jan 4Pushed 9y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (7)Used By (2)

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

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 82.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 ~265 days

Recently: every ~22 days

Total

6

Last Release

3557d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7e849fc0a7f371ae8821cef67a7388d34300f59bb2fb62fe3a2d6334c69a3d1?d=identicon)[fkrauthan](/maintainers/fkrauthan)

---

Top Contributors

[![fkrauthan](https://avatars.githubusercontent.com/u/1679841?v=4)](https://github.com/fkrauthan "fkrauthan (37 commits)")[![marekkalnik](https://avatars.githubusercontent.com/u/548629?v=4)](https://github.com/marekkalnik "marekkalnik (3 commits)")[![c33s](https://avatars.githubusercontent.com/u/649209?v=4)](https://github.com/c33s "c33s (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)")[![johnkary](https://avatars.githubusercontent.com/u/135607?v=4)](https://github.com/johnkary "johnkary (1 commits)")[![jmather](https://avatars.githubusercontent.com/u/450978?v=4)](https://github.com/jmather "jmather (1 commits)")

---

Tags

assetic-bundlebundlephpsymfonysymfony-bundlecssasseticassetrewriteSymfony Bundlecss urlcssrewrite

### Embed Badge

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

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

###  Alternatives

[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[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)[mmanos/laravel-casset

An asset management package for Laravel 4.

102.6k](/packages/mmanos-laravel-casset)

PHPackages © 2026

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