New answers tagged


JControllerLegacy::getInstance() caches the first controller instance so you're actually getting an instance of your component's controller rather than Content controller. You can skip the controller and get the model directly instead: JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); $model = JModelLegacy::...


I managed to find this page in JDocs, while not looking for it, that looks like the closest thing to any sort of formal documentation although it is minimal. It is a start but it could do with a lot of more elaboration to put things in context as provided by @Sharky in his answer.


Components in J4 use a service-based approach which, in theory, should allow any naming convention. Although for that you'd have to write your own factories. But if you want to follow same conventions as Joomla core components, start by declaring a namespace in the component's manifest file. The namespace should be in this form: [Vendor]\Component\[Component ...


Did you have a look at the Joomla code itself on Github too? When I take a look at the php files in the tmpl directories of components and modules I see the following setup for classNames. modules => mod-modulenmame components => com-componentname For instance com_contact. The className for a single ...

Top 50 recent answers are included