So there is this deprecated message that pops up when using:
$toolbar = Toolbar::getInstance('toolbar');
Message:
4.0 will be removed in 6.0 Use the ToolbarFactoryInterface instead
Example: Factory::getContainer()->get(ToolbarFactoryInterface::class)->createToolbar($name)
So when using:
$toolbar = Factory::getContainer()->get(ToolbarFactoryInterface::class)->createToolbar('toolbar')
and then add (for example)
$toolbar->createButton('view.add')
it shows just the error that Button() could not been loaded. Anyone gets an example Code on how to use the ToolbarFactoryInterface class?
Another option would be to use the ToolbarHelper class but there I do not see a way to create "dropdowns" as used until now like so:
$toolbar = Toolbar::getInstance();
$dropdown = $toolbar->dropdownButton('status-group')
->text('JTOOLBAR_CHANGE_STATUS')
->toggleSplit(false)
->icon('fa fa-ellipsis-h')
->buttonClass('btn btn-action')
->listCheck(true);
$childBar = $dropdown->getChildToolbar();
$childBar->publish('events.publish')->listCheck(true);
$childBar->unpublish('events.unpublish')->listCheck(true);
$childBar->archive('events.archive')->listCheck(true);
At least to create such dropdownButtons we have to use the "old fashioned" way right now, correct?