示例#1
0
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
     }
 }