diff --git a/view/helpers/MsgViewHelper.php b/view/helpers/MsgViewHelper.php index 1283367..5b0f90f 100644 --- a/view/helpers/MsgViewHelper.php +++ b/view/helpers/MsgViewHelper.php @@ -18,6 +18,8 @@ class MsgViewHelper extends ViewHelper const WARNING = 'warning'; + protected $use_as_html = false; + private static $type_to_class = array( self::SUCCESS => 'success', self::ERROR => 'error', @@ -63,6 +65,12 @@ class MsgViewHelper extends ViewHelper Session::set(__CLASS__, array('message' => $msg, 'type' => $type)); } + public static function getType() + { + $msg = Session::get(__CLASS__, false); + return $msg ? $msg['type'] : ''; + } + public function withPrefix($css_prefix) { $this->css_prefix = $css_prefix; @@ -75,7 +83,7 @@ class MsgViewHelper extends ViewHelper if ($msg) { Session::del(__CLASS__); $type_to_class = static::getTypeToClass(); - return '
' . $this->view->escape($msg['message']) . '
'; + return '
' . (($this->use_as_html)?$msg['message']:$this->view->escape($msg['message'])) . '
'; } return ''; }