[quote="TrevorNT":1u3a6ma6]
$COMPLICATED_HREF = $this->create_callback_href(array('Base_BoxCommon', 'push_module'), array('ModGroup_ModName', 'body'), array('parameter'=>'value'));
So my question is this: is there a better/more correct way of doing this? Or am I just doing something wrong?
[/quote:1u3a6ma6]Hi,
However I think that's a proper solution and I would do something like that,
but yes - you're doing something wrong 🙂
to pass regular parameter to the body method use such code
$COMPLICATED_HREF = $this->create_callback_href(
array('Base_BoxCommon', 'push_module'),
array('ModGroup_ModName', 'body', array('first_param_value'))
);
I've splitted code into lines to show you what are parameters to the create_callback_href method. Your code was wrong because you were passing $indicator parameter.
public final function create_callback_href($func,$args=array(),$indicator=null,$mode=null) { ... }
and push_module method
public static function push_module($module = null, $func = null, $args = null, $constr_args = null, $name = null) { ... }
so args to the push_module are [module, func, args], but those args are also array.
Now your body method signature
public function body($first_param = null) { ... }
It's important to set default param, because menu or button indicated by Jasiek may not pass any parameter.
Regards,
Adam