Method "AssetController::adjustCssUrl()" has been created as blank

This commit is contained in:
Klimov Paul
2013-05-26 14:53:41 +03:00
parent afeee0a36c
commit ce6b73c88a
2 changed files with 71 additions and 0 deletions

View File

@@ -527,6 +527,23 @@ EOD
file_put_contents($outputFile, $content);
}
/**
* Adjusts CSS content allowing URL references pointing to the original resources.
* @param string $cssContent source CSS content.
* @param string $inputFilePath input CSS file name.
* @param string $outputFilePath output CSS file name.
* @return string adjusted CSS content.
*/
protected function adjustCssUrl($cssContent, $inputFilePath, $outputFilePath)
{
$callback = function($matches) use ($inputFilePath, $outputFilePath) {
return $matches[0];
};
$cssContent = preg_replace_callback('/[\w\-]:\s*url\("(.*)"\)+/is', $callback, $cssContent);
return $cssContent;
}
/**
* Creates template of configuration file for [[actionCompress]].
* @param string $configFile output file name.