Krumo::get_icon PHP Méthode

get_icon() public static méthode

public static get_icon ( $name, $title )
    public static function get_icon($name, $title)
    {
        $path = dirname(__FILE__) . "/icons/{$name}.png";
        $rel = static::calculate_relative_path($path);
        $ret = "<img style=\"padding: 0 2px 0 2px\" src=\"{$rel}\" title=\"{$title}\" alt=\"name\" />";
        return $ret;
    }

Usage Example

Exemple #1
0
 private static function sanitize_name($name)
 {
     // Check if the key has whitespace in it, if so show it and add an icon explanation
     $has_white_space = preg_match("/\\s/", $name);
     if ($has_white_space) {
         // Convert the white space to unicode underbars to visualize it
         $name = preg_replace("/\\s/", "&#9251;", $name);
         $title = "Note: Key contains white space";
         $icon = Krumo::get_icon("information", $title);
         $ret = $name . $icon;
     } else {
         $ret = $name;
     }
     return $ret;
 }
All Usage Examples Of Krumo::get_icon