calculate_relative_path() public static method

Calculate the relative path of a given absolute URL
public static calculate_relative_path ( $file, $returnDir = false ) : string
$file string The file to calculate the relative path of
$returnDir bool If set to true, only return the dirname
return string
Ejemplo n.º 1
0
 public static function get_icon($name, $title)
 {
     $path = dirname(__FILE__) . "/icons/{$name}.png";
     $rel = Krumo::calculate_relative_path($path);
     $ret = "<img style=\"padding: 0 2px 0 2px\" src=\"{$rel}\" title=\"{$title}\" alt=\"name\" />";
     return $ret;
 }