2017 © Pedro Peláez
 

library css-path-rewrite

Rewrite paths in css files, includes a filter for Assetic

image

kevbaldwyn/css-path-rewrite

Rewrite paths in css files, includes a filter for Assetic

  • Monday, January 19, 2015
  • by kevbaldwyn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 647 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 23 % Grown

The README.md

css-path-rewrite

Rewrite paths in css files to things like images from local to remote (or anything else). Currently only handles "root relative" url paths, ie urls that start with /., (*1)

Installation

With Composer, (*2)

"require": {
    ...
    "kevbaldwyn/css-path-rewrite":"0.*"
    ...
}

Composer Update:, (*3)

$ composer update kevbaldwyn/css-path-rewrite

Usage

To simply rewrite urls in a css file:, (*4)

$cssFileContent = file_get_contents('/path/to/my/file.css');
$writer = new KevBaldwyn\CssPathRewrite\Rewriter($cssFileContent, 'http://www.example.com');
$output = $writer->rewrite();
file_put_contents('/path/to/my/file.css', $output);

Or if using assetic simply include in your filters array:, (*5)

$css = new AssetCollection(array(
    new FileAsset('/path/to/src/styles.less', array(new LessFilter())),
    new GlobAsset('/path/to/css/*'),
), array(
    new KevBaldwyn\CssPathRewrite\Assetic\Filter('http://www.example.com'),
));

The Versions

19/01 2015

dev-master

9999999-dev

Rewrite paths in css files, includes a filter for Assetic

  Sources   Download

The Requires

 

The Development Requires

by Kevin Baldwyn

css rewrite assets compression assetic minification

19/01 2015

0.1.3

0.1.3.0

Rewrite paths in css files, includes a filter for Assetic

  Sources   Download

The Requires

 

The Development Requires

by Kevin Baldwyn

css rewrite assets compression assetic minification

19/12 2014

0.1.2

0.1.2.0

Rewrite paths in css files, includes a filter for Assetic

  Sources   Download

The Requires

 

The Development Requires

by Kevin Baldwyn

css rewrite assets compression assetic minification

19/12 2014

0.1.1

0.1.1.0

Rewrite paths in css files, includes a filter for Assetic

  Sources   Download

The Requires

 

The Development Requires

by Kevin Baldwyn

css rewrite assets compression assetic minification

19/12 2014

0.1

0.1.0.0

Rewrite paths in css files, includes a filter for Assetic

  Sources   Download

The Requires

 

The Development Requires

by Kevin Baldwyn

css rewrite assets compression assetic minification