[eluser]J Maxwell[/eluser]
I have searched a bit for this, but strugging to work out how to achieve what I want.
I am querying a database, then dynamically loading assets based on the results of the query.
However, I need to do something like this:
Code:
foreach ($w as $widget) :
/* i've written an extension to the CI_Loader that enables me to add widgets.
* It loads them into $this->widget_name however, because i need to access them during a
* foreach loop, then I can't manually enter the name of the widget in order to use it, it needs
* to come from the variable
*/
$CI->load->widget($widget);
$CI->$widget->do_stuff_here();
endforeach;
The problem with this is it keeps throwing member function on non-object errors. How do I refer to the widget I just created without being able to type the name in?
Cheers,
John