Back to Dropdown class

Method edit

public static void
edit
(mixed $id, mixed $prefix = '', mixed $customLink = '')
Append an edit item to the current dropdown menu
Parameters
  • int $id Record ID
  • string $prefix Task prefix
  • string $customLink The custom link if dont use default Joomla action format
Returns
  • void
Since
  • 3.0
Class: Dropdown
Project: Joomla

Method edit - Source code

/**
 * Append an edit item to the current dropdown menu
 *
 * @param   integer  $id          Record ID
 * @param   string   $prefix      Task prefix
 * @param   string   $customLink  The custom link if dont use default Joomla action format
 *
 * @return  void
 *
 * @since   3.0
 */
public static function edit($id, $prefix = '', $customLink = '')
{
    static::start();
    if (!$customLink) {
        $option = Factory::getApplication()->input->getCmd('option');
        $link = 'index.php?option=' . $option;
    } else {
        $link = $customLink;
    }
    $link .= '&task=' . $prefix . 'edit&id=' . $id;
    $link = Route::_($link);
    static::addCustomItem(Text::_('JACTION_EDIT'), $link);
}