I started a component com_xxx_yyy in Joomla 4 from scratch to learn the new API the hard way.

Parts of the structure

- Controller
--- DisplayController.php
--- YyyController.php
- View
--- Yyy
------ HtmlView.php
--- Yyys
------ HtmlView.php

In Yyys/HtmlView.php I add a toolbar button $toolbar->addNew('yyy.new') then Joomla 4 uses the YyyController.php but uses the component name option=com_yyy

If I change the button to $toolbar->addNew('xxx_yyy.new') then it uses the right component name option=com_xxx_yyy but wants the Controller be called Xxx_YyyController.php

The most examples I found where the trivial default way. I looked into Joomla! Docu and the boilerplate on github.

In Joomla! 3 you could to such naming mappings in the xxx_xxx.php or the controller.php, but both not existing in Joomla! 4.

I looked into com_content and there it is exactly how I want. view articles adds a button article.new and then it loads option=com_content;view=article

But I don't see the missing point on my side.

1 Answer 1


Ok I found the reason myself.

Joomla 4 uses the namespace to detect the components name and creates the option=com_xxx_yyy from it.

So a namespace like

Vendor/Component/XXX_YYY results in option=com_xxx_yyy

Vendor/Component/XZYZZZ results in option=com_xzyzzz

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.