Created
February 16, 2011 07:05
-
-
Save devi/828977 to your computer and use it in GitHub Desktop.
Kohana HTML::style, HTML::script extended
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Extend HTML::style | |
* | |
* @param string File name | |
* @param array Default attributes | |
* @param string Spesific browser logic/condition | |
* @param mixed Protocol to pass to URL::base() | |
* @param boolean Include the index page | |
* @return string | |
*/ | |
public static function style($file, array $attributes = NULL, $browser = NULL, $protocol = NULL, $index = FALSE) | |
{ | |
$style = HTML::style($file,$attributes, $protocol, $index); | |
if ($browser) | |
return '<!--[if '.$browser.' ]>'.$style.'<![endif]-->'; | |
return $style; | |
} | |
/* | |
* Extend HTML::script | |
* | |
* @param string File name | |
* @param array Default attributes | |
* @param string Spesific browser logic/condition | |
* @param mixed Protocol to pass to URL::base() | |
* @param boolean Include the index page | |
* @return string | |
*/ | |
public static function script($file, array $attributes = NULL, $browser = NULL, $protocol = NULL, $index = FALSE) | |
{ | |
$script = HTML::script($file, $attributes, $protocol, $index); | |
if ($browser) | |
return '<!--[if '.$browser.' ]>'.$script.'<![endif]-->'; | |
return $script; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment