src/Forms/Form.php
public function sessionMessage($message, $type = ValidationResult::TYPE_ERROR, $cast = ValidationResult::CAST_TEXT)
    {
        $this->setMessage($message, $type, $cast);
        $result = $this->getSessionValidationResult() ?: ValidationResult::create();
        $result->addMessage($message, $type, null, $cast);
        $this->setSessionValidationResult($result);
    }
public function sessionMessage($message, $type = ValidationResult::TYPE_ERROR, $cast = ValidationResult::CAST_TEXT)
    {
        $this->setMessage($message, $type, $cast);
        $result = $this->getSessionValidationResult() ?: ValidationResult::create();
        $result->addMessage($message, $type, null, $cast);
        $this->setSessionValidationResult($result);
    }
public function sessionMessage ( $ message , $ type = ValidationResult :: TYPE_ERROR , $ cast = ValidationResult :: CAST_TEXT ) { $ this -> setMessage ( $ message , $ type , $ cast ) ; $ result = $ this -> getSessionValidationResult ( ) ? : ValidationResult :: create ( ) ; $ result -> addMessage ( $ message , $ type , null , $ cast ) ; $ this -> setSessionValidationResult ( $ result ) ; }
Set a message to the session, for display next time this form is shown.

@param string $message the text of the message
@param string $type Should be set to good, bad, or warning.
@param string|bool $cast Cast type; One of the CAST_ constant definitions.
Bool values will be treated as plain text flag.
Set a message to the session for display next time this form is shown .