Created
May 21, 2012 15:24
-
-
Save deletosh/2762902 to your computer and use it in GitHub Desktop.
add the multiple scripts/styles in kohana
This file contains hidden or 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
<?php defined('SYSPATH') or die('No direct script access.'); | |
class HTML extends Kohana_HTML { | |
public static function scripts(array $scripts, $attributes=array(), $index = FALSE) | |
{ | |
$response = ''; | |
//Data sanitisation | |
$index = $index ? TRUE : false; | |
if ( !is_array($attributes) ) $attributes = array(); | |
foreach ( $scripts as $script ) | |
$response .= html::script($script, $attributes, $index); | |
return $response; | |
} | |
public static function styles(array $styles, $attributes=array(), $index = FALSE) | |
{ | |
$response = ''; | |
//Data sanitisation | |
$index = $index ? TRUE : false; | |
if ( !is_array($attributes) ) $attributes = array(); | |
foreach ( $styles as $style ) | |
$response .= html::style($style, $attributes, $index); | |
return $response; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment