src/Forms/FormMessage.php
public function setMessage(
        $message,
        $messageType = ValidationResult::TYPE_ERROR,
        $messageCast = ValidationResult::CAST_TEXT
    ) {
        if (!in_array($messageCast, [ValidationResult::CAST_TEXT, ValidationResult::CAST_HTML])) {
            throw new InvalidArgumentException("Invalid message cast type");
        }
        $this->message = $message;
        $this->messageType = $messageType;
        $this->messageCast = $messageCast;
        return $this;
    }
public function setMessage(
        $message,
        $messageType = ValidationResult::TYPE_ERROR,
        $messageCast = ValidationResult::CAST_TEXT
    ) {
        if (!in_array($messageCast, [ValidationResult::CAST_TEXT, ValidationResult::CAST_HTML])) {
            throw new InvalidArgumentException("Invalid message cast type");
        }
        $this->message = $message;
        $this->messageType = $messageType;
        $this->messageCast = $messageCast;
        return $this;
    }
public function setMessage ( $ message , $ messageType = ValidationResult :: TYPE_ERROR , $ messageCast = ValidationResult :: CAST_TEXT ) { if ( ! in_array ( $ messageCast , [ ValidationResult :: CAST_TEXT , ValidationResult :: CAST_HTML ] ) ) { throw new InvalidArgumentException ( "Invalid message cast type" ) ; } $ this -> message = $ message ; $ this -> messageType = $ messageType ; $ this -> messageCast = $ messageCast ; return $ this ; }
Sets the error message to be displayed on the form field.

Allows HTML content, so remember to use Convert::raw2xml().

@param string $message Message string
@param string $messageType Message type
@param string $messageCast
@return $this
Sets the error message to be displayed on the form field .