Back to CoreButtonsTrait class

Method apply

public \Joomla\CMS\Toolbar\Button\StandardButton
apply
(string $task, string $text = 'JTOOLBAR_APPLY')
Writes a save button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0

Method apply - Source code

/**
 * Writes a save button for a given option.
 * Apply operation leads to a save action only (does not leave edit mode).
 *
 * @param   string  $task  The task name of this button.
 * @param   string  $text  The text of this button.
 *
 * @return  StandardButton
 *
 * @since   4.0.0
 */
public function apply(string $task, string $text = 'JTOOLBAR_APPLY') : StandardButton
{
    return $this->standardButton('apply', $text)->task($task)->formValidation(true);
}