コード例 #1
0
ファイル: cssurirewriter.php プロジェクト: nockout/tshpro
 /**
  * In CSS content, prepend a path to relative URIs
  *
  * @param string $css
  *
  * @param string $path The path to prepend.
  *
  * @return string
  */
 public static function prepend($css, $path)
 {
     self::$_prependPath = $path;
     $css = self::_trimUrls($css);
     // append
     $css = preg_replace_callback('/@import\\s+([\'"])(.*?)[\'"]/', array(self::$className, '_processUriCB'), $css);
     $css = preg_replace_callback('/url\\(\\s*([^\\)\\s]+)\\s*\\)/', array(self::$className, '_processUriCB'), $css);
     self::$_prependPath = null;
     return $css;
 }