// Load the JToolbarHelper library JLoader::import('joomla.toolbar.toolbar'); // Create a new save button using JToolbarHelper JToolbarHelper::save('myform.save'); // Register a function to be called when the button is clicked JToolbarHelper::custom('myform.save', 'save', '', 'Save', false);
// Load the JToolbarHelper library JLoader::import('joomla.toolbar.toolbar'); // Create a custom icon using JToolbarHelper JToolbarHelper::custom('myicon', 'icon.png', '', 'My Icon', false);This code creates a new custom icon in the toolbar using JToolbarHelper::custom(). The icon is given the ID "myicon" and the image file "icon.png" is used as the icon image. The text "My Icon" is displayed next to the icon in the toolbar. JToolbarHelper is part of the Joomla Platform library, which is included with Joomla! CMS.