// Assuming the URL parameter is: index.php?option=com_example&view=some_view&task=run $jinput = JFactory::getApplication()->input; $cmd = $jinput->getCmd('task'); // $cmd will be 'run'
$default = 'default_command'; $jinput = JFactory::getApplication()->input; $cmd = $jinput->getCmd('task', $default); // $cmd will be 'default_command'In this example, the `getCmd` method is called with a default value of 'default_command' if the task command is not found in the URL parameter. The `$cmd` variable will be assigned the default value if the task command is not present in the URL parameter. Package library: Joomla Framework (https://github.com/joomla-framework)