Given the following menu entries

enter image description here

Route::_('index.php?option=com_mycomponent&view=categories&extension=com_mycomponent.countries') should return '/countries' but in fact it returns '/diseases'.

This is happening because Route settles for the first menu item with matching component_id and query parameter view.

I've solved the issue by overriding the MenuRules class with my own, but it seems a bit of an overkill.

Is there a proper way to have Route consider my custom parameters?

1 Answer 1


What you're doing is the proper way. The included rules are suitable for basic components, they're not meant to work for every known component. In fact, some of the core components are running into the exact same issue, but that's currently accepted as expected behavior. Anyways, current router API exists so developers can easily customize routing while at the same time using some of the rules provided in core.

Your Answer

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

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