Merge branch 'MDL-39337' of git://github.com/apsdehal/moodle

This commit is contained in:
Damyon Wiese
2014-02-18 15:37:49 +08:00
+16
View File
@@ -1101,6 +1101,22 @@ class html_writer {
return $output;
}
/**
* Generates a simple image tag with attributes.
*
* @param string $src The source of image
* @param string $alt The alternate text for image
* @param array $attributes The tag attributes (array('height' => $max_height, 'class' => 'class1') etc.)
* @return string HTML fragment
*/
public static function img($src, $alt, array $attributes = null) {
$attributes = (array)$attributes;
$attributes['src'] = $src;
$attributes['alt'] = $alt;
return self::empty_tag('img', $attributes);
}
/**
* Generates random html element id.
*