Joomla-Ajax-Interface/component

Retrieving Params

Closed this issue · 4 comments

So I can't see how to retrieve a given modules params - you may have more than 1 instance so you can't pass mod_something. And obviously for a distributed module you have no clue what a users title of the module is going to be. Not sure what the obvious solution is - except maybe an optional parameter to the module method to pass in the title if it has been passed via the AJAX request

Something like:

if ($input->get('title'))
{
  $results = call_user_func($class . '::' . $method . 'Ajax', $input->get('title'));
}
else
{
  $results = call_user_func($class . '::' . $method . 'Ajax')
}

I'm not sure if I understand the issue. You can pass any number of variables directly to your module via the URL.

Is the case that your Ajax method depends on certain parameter settings? Wouldn't the module access it's own parameters directly?

Maybe code will help clarify.

https://github.com/betweenbrain/Ajax-Session-Module/blob/master/helper.php#L19

Yes when your retrieving your modules params there your fixed to the module with a title of session. I'm having a really slow day today - so may well just be me - but somewhere you're going to need to retrieve the instance of the module. I presume the best way is to pass it with the AJAX?

Wait. I'm an idiot. Ignore this. Forget I even posted this :P

😆 No worries!