From 19860865d169a3aa02813fe886766f32066504a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Peri=C4=87?= Date: Tue, 7 Apr 2015 20:45:59 +0200 Subject: [PATCH] Update HtmlBuilder.php Add support for Favicon files. --- src/HtmlBuilder.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index 44954d3..1e9f797 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -96,6 +96,25 @@ class HtmlBuilder { return '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 'attributes($attributes).'>'.PHP_EOL; + } /** * Generate a HTML link.