WEB-INF.cftags.component coldbox.system.FrameworkSupertype coldbox.system.Plugin coldbox.system.plugins.MessageBox
This is the MessageBox plugin. It uses the session/client scope to save messages.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
JSON
|
true
|
false
|
Constructor Summary | |
---|---|
init(any controller)
Constructor. |
Method Summary | |
---|---|
void
|
addData(string key, string value)
Add data that can be used for arbitrary stuff. |
void
|
append(string message)
Append a message to the MessageBox. |
void
|
appendArray(Array messageArray)
Append an array of messages to the MessageBox. |
void
|
clearMessage()
Clears the message structure by deleting it from the session scope. |
void
|
error([string message=''], [Array messageArray])
Facade to setmessage with error type. |
private any
|
flattenMessageArray(Array messageArray)
|
array
|
getData([boolean clearData='true'])
Add data that can be used for arbitrary stuff. |
string
|
getDataJSON([boolean clearData='true'])
Get the data as JSON. |
any
|
getMessage()
Returns a structure of the message if it exists, else a blank structure. |
void
|
info([string message=''], [Array messageArray])
Facade to setmessage with info type. |
boolean
|
isEmptyMessage()
Checks wether the MessageBox is empty or not. |
private string
|
isValidMessageType(string type)
Returns a list of valid message types. |
void
|
prependArray(Array messageArray)
Prepend an array of messages to the MessageBox. |
void
|
putData(array theData)
Add data that can be used for arbitrary stuff. |
any
|
renderMessage(string type, [string message=''], [Array messageArray], [string template=''])
Renders a messagebox immediately for you with the passed in arguments. |
any
|
renderit([boolean clearMessage='true'], [string template=''])
Renders the message box and clears the message structure by default. |
void
|
setMessage(string type, [string message=''], [Array messageArray])
Create a new MessageBox. |
void
|
warn([string message=''], [Array messageArray])
Facade to setmessage with warning type. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
controller
- coldbox.system.web.ControllerProperty Detail |
---|
inject
- coldbox:plugin:JSONrequired
- falseserializable
- trueMethod Detail |
---|
Add data that can be used for arbitrary stuff
key
value
Append a message to the MessageBox. If there is no message, then it sets the type to information.
message
- The message to append, it does not include any breaks or delimiters. You must send that.Append an array of messages to the MessageBox. If there is no message, then it sets the type to information.
messageArray
- The array of messages to append. You must send that.Clears the message structure by deleting it from the session scope.
Facade to setmessage with error type
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a messageArray
- Array of messages to flattenAdd data that can be used for arbitrary stuff
clearData
- Flag to clear the data structure or not after rendering. Default is true.Get the data as JSON
clearData
- Flag to clear the data structure or not after rendering. Default is true.Returns a structure of the message if it exists, else a blank structure.
Facade to setmessage with info type
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a Checks wether the MessageBox is empty or not.
Returns a list of valid message types.
type
Prepend an array of messages to the MessageBox. If there is no message, then it sets the type to information.
messageArray
- The array of messages to append. You must send that.Add data that can be used for arbitrary stuff
theData
Renders a messagebox immediately for you with the passed in arguments
type
- The message type.Available types [error][warning][info]message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a template
- An optional template to use for rendering instead of core or settingRenders the message box and clears the message structure by default.
clearMessage
- Flag to clear the message structure or not after rendering. Default is true.template
- An optional template to use for rendering instead of core or settingCreate a new MessageBox. Look at types.
type
- The message type.Available types [error][warning][info]message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a Facade to setmessage with warning type
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a