What I am trying to do is get the router for the component (iCagenda) to work with a url of this form:

mysite.com/index.php/events/register?eid=1111, where I can map eid to the item id

The deafult is mysite.com/index.php/events/id-alias/register

In the component's router, there is a function iCagendaBuildRoute( &$query )

This function returns $segments (for the url string I guess), and I have it working so that the $segments array is the same whether the url form is default or as I have above. I thought that was good sign.

But then in the function iCagendaParseRoute( $segments )

The $segments variable is not the same as returned in iCagendaBuildRoute.

I think it has something to do with the local versus global variables. Joomla must be doing some additional checking which is resulting in the passed version of $segments to be different...

I can't figure this out...

  • Can you check function calling of iCagendaParseRoute($segments)? Before function call they might have changed in data. Apr 10, 2015 at 11:20
  • Is mysite.com/index.php/events/register a menu item on the site or is it the result of JRoute::_(index.php?option=your_component&so_on..') ?
    – Hung Tran
    Apr 11, 2015 at 8:31
  • Not sure what you mean, but I just got it to work fine by making sure that the component router created the $var array as if the url was like the default url.
    – Brian
    Apr 11, 2015 at 10:01

1 Answer 1


If you are passing value such as ?eid=111. You can retrieve that with Joomla Input method.

Try this

$id = JFactory::getApplication()->input->get('eid', 0);

First argument of get is key name of URL query string, where second argument is default value in case there is no value detected for eid.

  • I restated my question. Hopefully it is more clear now.
    – Brian
    Apr 10, 2015 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.