public function mount($group, $path = null)
{
if (is_object($group)) {
$groupClassName = get_class($group);
$groupInstance = $group;
} else {
$groupClassName = $group;
$groupInstance = null;
}
$parts = explode('\\', $groupClassName);
unset($parts[0]);
array_pop($parts);
$module = implode('\\', $parts);
if ($path === null) {
$path = '/' . $module;
}
$path = rtrim($path, '/');
$this->_groups[] = ['path' => $path, 'module' => $module, 'groupClassName' => $groupClassName, 'groupInstance' => $groupInstance];
$this->_modules[$module] = $path ?: '/';
return $this;
}