Flourish PHP Unframework

fMessaging

static class, v1.0.0b7

Provides session-based messaging for page-to-page communication

Changes:
1.0.0b7Fixed a small PHPDoc error 3/15/10
1.0.0b6Updated class to use new fSession API 10/23/09
1.0.0b5Made the $recipient parameter optional for all methods 7/8/09
1.0.0b4Added support for '*' and arrays of names to check() 6/2/09
1.0.0b3Updated class to use new fSession API 5/8/09
1.0.0b2Changed show() to accept more than one message name, or * for all messages 1/12/09
1.0.0bThe initial implementation 3/5/08

Static Methods

::check() public

Checks to see if a message exists of the name specified for the recipient specified

Signature

boolean check( string $name, string $recipient=NULL )

Parameters

string $name The name or array of names of the message(s) to check for, or '*' to check for any
string $recipient The intended recipient

Returns

If a message of the name and recipient specified exists

::create() public

Creates a message that is stored in the session and retrieved by another page

Signatures

void create( string $name, string $recipient, string $message )

void create( string $name, string $message )

Parameters

string $name A name for the message
string $recipient The intended recipient - this may be ommitted
string $message The message to send

::reset() internal public

Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code

Resets the data of the class

Signature

void reset( )

::retrieve() public

Retrieves and removes a message from the session

Signature

string retrieve( string $name, string $recipient=NULL )

Parameters

string $name The name of the message to retrieve
string $recipient The intended recipient

Returns

The message contents

::show() public

Retrieves a message, removes it from the session and prints it - will not print if no content

The message will be printed in a p tag if it does not contain any block level HTML, otherwise it will be printed in a div tag.

Signature

boolean show( mixed $name, string $recipient=NULL, string $css_class=NULL )

Parameters

mixed $name The name or array of names of the message(s) to show, or '*' to show all
string $recipient The intended recipient
string $css_class Overrides using the $name as the CSS class when displaying the message - only used if a single $name is specified

Returns

If one or more messages was shown