|
ColdBox Platform v3.8.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.FrameworkSupertype
coldbox.system.Plugin
coldbox.system.plugins.MessageBox
public class MessageBox
This is the MessageBox plugin. It uses the session/client scope to save messages.
Property Summary | ||||
---|---|---|---|---|
Type | Property & Description | Default | Serializable | Required |
any
|
JSON
Attributes:
|
|
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 |
---|
public init(any controller)
controller
- coldbox.system.web.ControllerProperty Detail |
---|
any JSON
inject
- coldbox:plugin:JSONrequired
- falseserializable
- truedefault
- Method Detail |
---|
public void addData(string key, string value)
key
value
public void append(string message)
message
- The message to append, it does not include any breaks or delimiters. You must send that.public void appendArray(Array messageArray)
messageArray
- The array of messages to append. You must send that.public void clearMessage()
public void error([string message=''], [Array messageArray])
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a private any flattenMessageArray(Array messageArray)
messageArray
- Array of messages to flattenpublic array getData([boolean clearData='true'])
clearData
- Flag to clear the data structure or not after rendering. Default is true.public string getDataJSON([boolean clearData='true'])
clearData
- Flag to clear the data structure or not after rendering. Default is true.public any getMessage()
public void info([string message=''], [Array messageArray])
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a public boolean isEmptyMessage()
private string isValidMessageType(string type)
type
public void prependArray(Array messageArray)
messageArray
- The array of messages to append. You must send that.public void putData(array theData)
theData
public any renderMessage(string type, [string message=''], [Array messageArray], [string template=''])
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 settingpublic any renderit([boolean clearMessage='true'], [string template=''])
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 settingpublic void setMessage(string type, [string message=''], [Array messageArray])
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 public void warn([string message=''], [Array messageArray])
message
- The message to show.messageArray
- You can also send in an array of messages to render separated by a
|
ColdBox Platform v3.8.0 | ||||
FRAMES |