Development Guide

Success / Failure / ... Messages

Messages are displayed by one of the following ilUtil methods:

  • ilUtil::sendInfo($lng->txt("..."));
  • ilUtil::sendSuccess($lng->txt("..."));
  • ilUtil::sendFailure($lng->txt("..."));
  • ilUtil::sendQuestion($lng->txt("..."));
Each of them has a second optional parameter, that must be set to true, if the message should be displayed after a redirect.

// sending success message and redirecting to the next command
ilUtil::sendSuccess($this->lng->txt("msg_deleted"), true);
$ilCtrl->redirect($this, "view");

These methods should only be used in GUI classes.

Multi-Step Workflows

Workflows with multiple steps (e.g. copy/link) should usually present messages of type "Info" instead of "Success" after each (successful) step, if it is not a final step.

Cancel Actions

Cancel actions should usually not produce any message.