use Joomla\CMS\Toolbar\ToolbarHelper; $idList = $input->get('cid', array(), 'array'); $formToken = JSession::getFormToken(); ToolbarHelper::deleteList('', 'remove', 'JTOOLBAR_DELETE', 'Are you sure you want to delete the selected items?', 'remove');
use Joomla\CMS\Toolbar\ToolbarHelper; $id = $input->get('id', 0, 'int'); $formToken = JSession::getFormToken(); ToolbarHelper::deleteList('item.delete', '', 'JTOOLBAR_DELETE', 'Are you sure you want to delete this item?', 'delete');In this example, `deleteList` is used to create a button that triggers a confirmation dialog when clicked. The task 'item.delete' is defined in the controller, which is responsible for deleting the item with the given ID. The last parameter 'delete' is used to define the task in the controller. The package library used in these examples is Joomla\CMS\Toolbar\ToolbarHelper.