JToolBarHelper方法如何工作?

I am trying to understand for few weeks that how JtoolBarHelper methods work.

You can see the methods called in view class like this:

JToolBarHelper::addNew('controllername.methodname');

Here, the JToolBarHelper's addNew method uses like this:

public static function addNew($task = 'add', $alt = 'JTOOLBAR_NEW', $check = false)
{
    $bar = JToolBar::getInstance('toolbar');
    // Add a new button.
    $bar->appendButton('Standard', 'new', $alt, $task, $check);
}

So, now checking into JToolBar's getInstance method:

It returns the new JToolBar($name);. I have also insured to check in the constructor function. But nowhere I could find how addNew() method parameter is separated ie. how Joomla knows that the name before the dot is controller name and the name after is its method name.

I also checked with javascript code for Joomla.submmitbutton('controllername.methodname'); but could not find.

So, my question is how the parameter passed into JToolBarHelper method knows it is controller name before the dot?

This controller splitting is handled by Joomla core Controller files. The file path are different based on versions.

JControllerLegacy will be defined in either libraries/joomla/controller/legacy.php, libraries/cms/controller/legacy.php, or libraries/legacy/controller/legacy.php. in latest Joomla versions.

Older versions used /libraries/joomla/application/component/controller.php

Hope, it makes sense!