Back to BaseController class

Method setMessage

public string
setMessage
(mixed $text, mixed $type = 'message')
Sets the internal message that is passed with a redirect
Parameters
  • string $text Message to display on redirect.
  • string $type Message type. Optional, defaults to 'message'.
Returns
  • string Previous message
Since
  • 3.0

Method setMessage - Source code

/**
 * Sets the internal message that is passed with a redirect
 *
 * @param   string  $text  Message to display on redirect.
 * @param   string  $type  Message type. Optional, defaults to 'message'.
 *
 * @return  string  Previous message
 *
 * @since   3.0
 */
public function setMessage($text, $type = 'message')
{
    $previous = $this->message;
    $this->message = $text;
    $this->messageType = $type;
    return $previous;
}