/** * Appends a message to the messages list * * @param Message $message */ public function appendMessage($message) { if (is_string($message)) { $message = new Message($message); } $this->messages->appendMessage($message); }
/** * Appends a message to the messages list * * @param string $message */ public function appendMessage(Message $message, $elementName = null) { if (null == $elementName) { $this->messages->appendMessage($message); } else { $v = $this->getChainedValidation()->getValidation($elementName); if (!$v) { throw new \UForm\Exception('Unable to append message : element with ID=' . $elementName . ' is not part of the form.'); } $v->appendMessage($message); } }