Skip to content

Instantly share code, notes, and snippets.

@deletosh
Created May 21, 2012 15:24
Show Gist options
  • Save deletosh/2762902 to your computer and use it in GitHub Desktop.
Save deletosh/2762902 to your computer and use it in GitHub Desktop.
add the multiple scripts/styles in kohana
<?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