nikosdion / joomla_extensions_development

Joomla Extensions Development: a reference book
GNU Free Documentation License v1.3
10 stars 1 forks source link

Component namespace MUST contain "\Component\" #25

Closed HermanPeeren closed 1 year ago

HermanPeeren commented 1 year ago

Component namespace MUST contain "\Component\", followed by the extension name. Otherwise you would get the wrong component name in ComponentHelper::getComponentName().

Pull Request for Issue #24 .

Summary of Changes

Corrected the component namespace prefix in the text to contain "\Component\", followed by the component name. Added a summary of the 3 parts the component namespace prefix MUST consist of, mainly in chapters "Joomla 3 MVC vs Joomla 4 MVC" and "How things work Joomla 4.0 onwards" of the components section.

Added a paragraph on the use of the the addfieldprefix attribute to tell Joomla which namespace to use for custom form fields.

Reasoning

Although it is questionable that Joomla prescripts this format of a custom component namespace, which might not be necessary if ComponentHelper::getComponentName() would be changed, the goal is to provide a manual to build custom components that would work in the actual Joomla version.

HermanPeeren commented 1 year ago

Requested changes done.

nikosdion commented 1 year ago

Thank you very much!