RelativeCssPathFixer
This fixes import paths in CSS files if their location changes, e.g. when inlining or compressing css
This class is not part of the TYPO3 API.
Table of Contents
Methods
- fixRelativeUrlPaths() : string
- Fixes the relative paths inside of url() references in CSS files
- findAndReplaceUrlPathsByRegex() : string
- Finds and replaces all URLs by using a given regex
Methods
fixRelativeUrlPaths()
Fixes the relative paths inside of url() references in CSS files
public
fixRelativeUrlPaths(string $contents, string $newDir) : string
Parameters
- $contents : string
-
Data to process
- $newDir : string
-
directory referenced from current location
Return values
string —Processed data
findAndReplaceUrlPathsByRegex()
Finds and replaces all URLs by using a given regex
protected
findAndReplaceUrlPathsByRegex(string $contents, string $regex, string $newDir[, string $wrap = '|' ]) : string
Parameters
- $contents : string
-
Data to process
- $regex : string
-
Regex used to find URLs in content
- $newDir : string
-
Path to prepend to the original file
- $wrap : string = '|'
-
Wrap around replaced values
Return values
string —Processed data