Update HtmlBuilder.php

Add support for Favicon files.
This commit is contained in:
Toni Perić committed 2015-04-07 20:45:59 +02:00
1 parent 9af2030538
commit 19860865d1
1 file changed
+19
+19
View File
@@ -96,6 +96,25 @@ class HtmlBuilder {
return '<img src="'.$this->url->asset($url, $secure).'"'.$this->attributes($attributes).'>';
}
/**
* Generate a link to a Favicon file.
*
* @param string $url
* @param array $attributes
* @param bool $secure
* @return string
*/
public function favicon($url, $attributes = array(), $secure = null)
{
$defaults = array('rel' => 'shortcut icon', 'type' => 'image/x-icon');
$attributes = $attributes + $defaults;
$attributes['href'] = $this->url->asset($url, $secure);
return '<link'.$this->attributes($attributes).'>'.PHP_EOL;
}
/**
* Generate a HTML link.