[eluser]Flak[/eluser]
Well, I have a Slider library and a method to check what slide is loading, is it img or swf.
Code:
class Slider {
function loadTypes($type,$path,$name)
{
switch($type)
{
case 'swf':
$types = '[removed]http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js[removed]';
$types = '[removed]var so = new SWFObject("'.base_url().'/'.$path.'", "'.$name.'", "690", "270", "8", "#336699");so.write("flashcontent");[removed]';
break;
case 'img':
default:
$types = '<img src="'.base_url().'/'.$path.'" alt="'.$name.'">';
break;
}
return $types;
}
}
I have load library on controller,
And I was trying to call this on View:
Code:
<div id="promobox">
<? foreach($list->result() as $item): ?>
<? $this->Slider->loadTypes($item->type,$item->path,$item->name); ?>
<? endforeach?>
</div>
Which won't work. I know that maybe this don't work, but any idea how to achieve this.
Thanks.