forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 4
my helper
Derek Jones edited this page Jul 5, 2012
·
5 revisions
<?php
if (! function_exists('load_js')) {
function load_js($js='') {
if (empty($js)) {
return;
}
$CI =& get_instance();
$content = '';
if (is_array($js)) {
foreach ($js as $i) {
$content .= '<script type="text/javascript" src="'.$CI->config->site_url('/scripts/'.$i).'"></script>'."\n";
}
} else {
$content = '<script type="text/javascript" src="'.$CI->config->site_url('/scripts/'.$js).'"></script>'."\n";
}
unset($CI);
return $content;
}
}
if (! function_exists('load_css')) {
function load_css($css='', $media='all') {
if (empty($css)) {
return;
}
$CI =& get_instance();
$content = '';
if (is_array($css)) {
foreach ($css as $i) {
$content .= '<link type="text/css" rel="stylesheet" href="'.$CI->config->site_url('/styles/'.$i).'" media="'.$media.'" />'."\n";
}
} else {
$content = '<link type="text/css" rel="stylesheet" href="'.$CI->config->site_url('/styles/'.$css).'" media="'.$media.'" />'."\n";
}
unset($CI);
return $content;
}
}
?>