JFactory::getApplication()->enqueueMessage('My message', 'My Message Type')
Displays
My Message Type
My Message
Displays
my message type
My Message
Joomla 3.9
Suggest changing the function parameters to:
public function enqueueMessage($msg, $type='message', $format='strtolower')
And add a function exists check message enqueue line to:
_if (!empty($type) && function_exists($type))
{
$type = $format($type);
}
$this->messageQueue[] = array('message' => $msg, 'type' => $type);
There are other ways of getting round this, such as in the template, but this change puts the design decision into the hands of the component / module developer.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-08 22:42:53 |
Closed_By | ⇒ | Quy |
The type isn't meant to be used in this way. The type really should be a standardized value (which 4.0 provides by defining a set of message type constants that match up to the PSR-3 log levels basically), not a section heading or anything like that. Then it's up to the template to theme the message types.