?
avatar joomdonation
joomdonation
1 Apr 2017

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

avatar joomdonation joomdonation - open - 1 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Apr 2017
Category Components
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Apr 2017
Status New Needs Review
avatar mbabker
mbabker - comment - 2 Apr 2017

Naming it a display controller implies a single task controller. So that's not a good name.

Default seems a little "goofy".

avatar joomdonation
joomdonation - comment - 2 Apr 2017

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

avatar yvesh
yvesh - comment - 2 Apr 2017

Tough one, personally I would go with Controller than, makes most sense ..

avatar joomdonation
joomdonation - comment - 3 Apr 2017

Look like Controller is the best one, so I made PR ##15075 to change it

avatar joomdonation joomdonation - change - 3 Apr 2017
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2017-04-03 13:57:12
Closed_By joomdonation
avatar joomdonation joomdonation - close - 3 Apr 2017

Add a Comment

Login with GitHub to post a comment