J4.x

Namespace Conventions In Joomla

From Joomla! Documentation

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎français • ‎italiano
Joomla! 
4.0

Base Namespaces[edit]

The recommended naming conventions in Joomla 4 are the following:

Components[edit]

Core Components[edit]

  • Joomla\Component\<ComponentName>\<ClientName>
    • Joomla\Component\Content\Site
    • Joomla\Component\Content\Administrator

3rd Party Components[edit]

  • <CompanyName>\Component\<ComponentName>\<ClientName>
    • Acme\Component\Backup\Site
    • Acme\Component\Backup\Administrator


Example locations[edit]

Joomla\Component\Content\Site\Controller
components/com_content/Controller/ArticleController.php

Joomla\Component\Content\Administrator\Controller
administrator/components/com_content/Controller/ArticlesController.php

Modules[edit]

Core Modules[edit]

  • Joomla\Module\<ModuleName>\<ClientName>
    • Joomla\Module\UsersLatest\Site
    • Joomla\Module\Quickicon\Administrator

3rd Party Modules[edit]

  • <CompanyName>\Module\<ModuleName>\<ClientName>
    • Acme\Module\SubscriptionStatus\Site
    • Acme\Module\LastBackupStatus\Administrator

Example locations[edit]

Joomla\Module\Quickicon\Administrator\Dispatcher
administrator/modules/mod_quickicon/Dispatcher/Dispatcher.php

Joomla\Module\UsersLatest\Site\Helper
modules/mod_users_latest/Helper/UsersLatestHelper.php

Plugins[edit]

Core Plugins[edit]

  • Joomla\Plugin\<PluginGroup>\<PluginName>
    • Joomla\Plugin\System\Debug
    • Joomla\Plugin\Quickicon\Joomlaupdate

3rd Party Plugins[edit]

  • <CompanyName>\Plugin\<PluginGroup>\<PluginName>\
    • Acme\Plugin\System\BackupOnDemand

Example locations[edit]

Joomla\Plugin\System\Debug
plugins/system/debug/DataFormatter.php

Joomla\Plugin\Quickicon\Joomlaupdate\Extension
plugins/quickicon/joomlaupdate/Extension/Joomlaupdate.php

Framework[edit]

Joomla Framework Library[edit]

  • Joomla
    • Joomla\Session
    • Joomla\Image

Joomla CMS Library[edit]

  • Joomla\CMS
    • Joomla\CMS\Mail
    • Joomla\CMS\MVC

Example locations[edit]

Joomla\Session
libraries/vendor/joomla/session/src/Session.php

Joomla\CMS\Mail
libraries/src/Mail/Mail.php