Plugins:MessageBox
|
Exploring the MessageBox Plugin
Overview
This is the MessageBox plugin. It uses the session/client scope to save messages.
Some new convenience methods:
- info() : To render info message directly
- warning() : To render a warning
- error() : To render an error
If you want to style your own messagebox you will need to create a setting called: messagebox_style_override and set it to true. Then make sure the css for the messagebox exists.
settings = {
messagebox_style_override = true
};
You can now also render messages a-la-carte or on-demand by using the renderMessage method:
#getPlugin("MessageBox").renderMessage("info","Info Message")# #getPlugin("MessageBox").renderMessage("warning",flash.get('notice'))#
info
Facade to setmessage with info type
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| message | string | No | The message to show. | |
| messageArray | Array | No | --- | You can also send in an array of messages to render separated by a |
Examples
isEmpty
Checks wether the MessageBox is empty or not.
Returns
- This function returns boolean
Examples
error
Facade to setmessage with error type
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| message | string | No | The message to show. | |
| messageArray | Array | No | --- | You can also send in an array of messages to render separated by a |
Examples
setMessage
Create a new MessageBox. Look at types.
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | --- | The message type.Available types [error][warning][info] |
| message | string | No | The message to show. | |
| messageArray | Array | No | --- | You can also send in an array of messages to render separated by a |
Examples
renderMessage
Renders a messagebox immediately for you with the passed in arguments
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | --- | The message type.Available types [error][warning][info] |
| message | string | No | The message to show. | |
| messageArray | Array | No | --- | You can also send in an array of messages to render separated by a |
Examples
getMessage
Returns a structure of the message if it exists, else a blank structure.
Returns
- This function returns any
Examples
warn
Facade to setmessage with warning type
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| message | string | No | The message to show. | |
| messageArray | Array | No | --- | You can also send in an array of messages to render separated by a |
Examples
renderit
Renders the message box and clears the message structure by default.
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| clearMessage | boolean | No | true | Flag to clear the message structure or not after rendering. Default is true. |
Examples
clearMessage
Clears the message structure by deleting it from the session scope.
Returns
- This function returns void
Examples
appendArray
Append an array of messages to the MessageBox. If there is no message, then it sets the type to information.
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| messageArray | Array | Yes | --- | The array of messages to append. You must send that. |
Examples
append
Append a message to the MessageBox. If there is no message, then it sets the type to information.
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| message | string | Yes | --- | The message to append, it does not include any breaks or delimiters. You must send that. |

SideBar
User Login 




Comments (