In the current component dispatcher implement, if a request doesn't specify a controller, the dispatcher will use COMPONENT_NAME as default controller https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Cms/Dispatcher/Dispatcher.php#L131. The default controller, in most case, just contains display method to display a view in the component.
While it will be fine for com_content (because Content controller is not use yet), there would be problem with most of other components like com_banners, com_contact, com_categories... because with these components, COMPONENT_NAME is already used for different purpose and could not be default controller, see https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_banners/controllers/banners.php , https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_categories/controllers/categories.php#L19...
With that said, we will need to use a different name for default controller to avoid this conflict. Maybe use Display or Default as default controller name will work
Labels |
Added:
?
|
Category | ⇒ | Components |
Status | New | ⇒ | Needs Review |
What could be a good name, then? Was thinking about a generic name Controller like in current none namespace implement, but then there would be be more writing in the code:
class Controller extends \Joomla\Cms\Controller\Controller
Or
use \Joomla\Cms\Controller\Controller as CmsController;
class Controller extends CmsController
Tough one, personally I would go with Controller than, makes most sense ..
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-03 13:57:12 |
Closed_By | ⇒ | joomdonation |
Naming it a display controller implies a single task controller. So that's not a good name.
Default seems a little "goofy".