Download the PHP package kevbaldwyn/css-path-rewrite without Composer
On this page you can find all versions of the php package kevbaldwyn/css-path-rewrite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kevbaldwyn/css-path-rewrite
More information about kevbaldwyn/css-path-rewrite
Files in kevbaldwyn/css-path-rewrite
Download kevbaldwyn/css-path-rewrite
More information about kevbaldwyn/css-path-rewrite
Files in kevbaldwyn/css-path-rewrite
Vendor kevbaldwyn
Package css-path-rewrite
Short Description Rewrite paths in css files, includes a filter for Assetic
License
Package css-path-rewrite
Short Description Rewrite paths in css files, includes a filter for Assetic
License
Please rate this library. Is it a good library?
Informations about the package css-path-rewrite
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 /
.
Installation
With Composer
"require": {
...
"kevbaldwyn/css-path-rewrite":"0.*"
...
}
Composer Update:
$ composer update kevbaldwyn/css-path-rewrite
Usage
To simply rewrite urls in a css file:
$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:
$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'),
));
All versions of css-path-rewrite with dependencies
PHP Build Version
Package Version
The package kevbaldwyn/css-path-rewrite contains the following files
Loading the files please wait ....