Beispiel #1
0
 /**
  * Prepend a path to relative URIs in CSS files
  * 
  * @param string $css
  * 
  * @param string $path The path to prepend.
  * 
  * @return string
  */
 public static function prepend($css, $path)
 {
     self::$_prepend_path = $path;
     $css = self::_trim_urls($css);
     // append
     $css = preg_replace_callback('/@import\\s+([\'"])(.*?)[\'"]/', array(self::$class_name, '_process_uri_cb'), $css);
     $css = preg_replace_callback('/url\\(\\s*([^\\)\\s]+)\\s*\\)/', array(self::$class_name, '_process_uri_cb'), $css);
     $css = preg_replace_callback('/src=\'\\s*([^\\)\\s]+)\\s*\'/', array(self::$class_name, '_process_src_cb'), $css);
     self::$_prepend_path = null;
     return $css;
 }