Unfortunately, it looks like adding this functionality would break existing functionality with how flashing messages works right now. The following is from phalcon/flash.zep, starting with line 224.
public function outputMessage(string type, var message)
{
boolean automaticHtml, implicitFlush;
var content, cssClasses, classes, typeClasses, eol, msg,
htmlMessage, htmlAttributes, autoEscape, escaper, preparedMsg;
let automaticHtml = (bool) this->_automaticHtml,
autoEscape = (bool) this->_autoescape;
if automaticHtml === true {
let classes = this->_cssClasses;
if fetch typeClasses, classes[type] {
if typeof typeClasses == "array" {
let cssClasses = " class=\"" . join(" ", typeClasses) . "\"";
} else {
let cssClasses = " class=\"" . typeClasses . "\"";
}
} else {
let cssClasses = "";
}
let eol = PHP_EOL;
}
...
}
The way I envision this working was to set an array for each level, the first element being classes, the second being an attribute string. Since this indicates that the classes can be an array, I can only assume this has been addressed by someone else in the past, and needed the classes attached to levels to be able to defined by an array instead of a string.
I'd want some input from one of the core devs to see if a change around this would be worth persuing.
Hi,
NFR should be posted on github
You can give a try to add it by yourself, it should be somewhere here: https://github.com/phalcon/cphalcon/blob/master/phalcon/flash.zep#L221