in the example below, how do i pass parameters to magic_tabs_example_callback() via magic_tabs_get?

...
print magic_tabs_get('magic_tabs_example_callback');  
...
function magic_tabs_example_callback($active = 0, $a1, $a2) 
{
...
}

BTW, the example causes error, warning: Missing argument 2 for magic_tabs_example_callback() in D:\Apache2.2\htdocs\d66\sites\all\modules\magic_tabs\magic_tabs.module on line 260.

I actually want to pass values to $a1, $a2, but don't know how.

Thanks!

Comments

newbuntu’s picture

I sort of got it working. I don't know if this is the intended way to do it:

print magic_tabs_get('magic_tabs_example_callback', 0, 'foo', 'bar');
dawehner’s picture

Status: Active » Fixed

this is the exact way to do it.

you can pass as many arguments to the function as you want, thats the power of call_user_func_array

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tommytom’s picture

how can I pass %nid argument to the view ??