‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\RelativeCssPathFixer Class Reference

Public Member Functions

string fixRelativeUrlPaths (string $contents, string $newDir)
 

Protected Member Functions

string findAndReplaceUrlPathsByRegex (string $contents, string $regex, string $newDir, string $wrap='|')
 

Detailed Description

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.

Definition at line 28 of file RelativeCssPathFixer.php.

Member Function Documentation

◆ findAndReplaceUrlPathsByRegex()

string TYPO3\CMS\Core\Resource\RelativeCssPathFixer::findAndReplaceUrlPathsByRegex ( string  $contents,
string  $regex,
string  $newDir,
string  $wrap = '|' 
)
protected

Finds and replaces all URLs by using a given regex

Parameters
string$contents‪Data to process
string$regex‪Regex used to find URLs in content
string$newDir‪Path to prepend to the original file
string$wrap‪Wrap around replaced values
Returns
‪string Processed data

Definition at line 61 of file RelativeCssPathFixer.php.

Referenced by TYPO3\CMS\Core\Resource\RelativeCssPathFixer\fixRelativeUrlPaths().

◆ fixRelativeUrlPaths()

string TYPO3\CMS\Core\Resource\RelativeCssPathFixer::fixRelativeUrlPaths ( string  $contents,
string  $newDir 
)

Fixes the relative paths inside of url() references in CSS files

Parameters
string$contents‪Data to process
string$newDir‪directory referenced from current location
Returns
‪string Processed data

Definition at line 37 of file RelativeCssPathFixer.php.

References TYPO3\CMS\Core\Resource\RelativeCssPathFixer\findAndReplaceUrlPathsByRegex().