Class mr_html_notify

Description

MR HTML Notify

This model is used to add messages to the session which can then be printed on subsequent page loads.

Use case: submit data to be saved, set a message with mr_html_notify like "Changes Saved" and then redirect to the orignal screen and display the message.

This class is tightly integrated with mr_controller.

Located in /html/notify.php (line 42)


	
			
Class Constant Summary
 BAD = 'notifyproblem'
 GOOD = 'notifysuccess'
Variable Summary
string $align
string $component
Method Summary
mr_html_notify add (string $identifier, [string $class = self::BAD], [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
mr_html_notify add_string (string $string, [string $class = self::BAD], [string $align = NULL])
mr_html_notify bad (string $identifier, [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
string get_messages ([boolean $clear = true])
mr_html_notify __construct ([string $component = ''], [string $align = 'center'])
mr_html_notify good (string $identifier, [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
mr_html_notify set_align (string $align)
mr_html_notify set_component (string $component)
Variables
string $align = 'center' (line 65)

Message alignment

  • access: protected
string $component = '' (line 58)

Get string component

  • access: protected
Methods
add (line 142)

Adds a message to be printed. Messages are printed by calling print().

mr_html_notify add (string $identifier, [string $class = self::BAD], [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
  • string $identifier: The string identifier to use in get_string()
  • string $class: Class to be passed to notify(). Usually notifyproblem or notifysuccess.
  • mixed $a: To be passed in the call to get_string()
  • string $component: Get string component
  • string $align: Alignment of the message
add_string (line 158)

Add a string to be printed

mr_html_notify add_string (string $string, [string $class = self::BAD], [string $align = NULL])
  • string $string: The string to be printed
  • string $class: The class to be passed to notify(). Usually notifyproblem or notifysuccess.
  • string $align: Alignment of the message
bad (line 124)

Add a bad message

  • access: public
mr_html_notify bad (string $identifier, [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
  • string $identifier: The string identifier to use in get_string()
  • mixed $a: To be passed in the call to get_string()
  • string $component: Get string component
  • string $align: Alignment of the message
get_messages (line 179)

Get all messages added to the session.

  • access: public
  • uses: $SESSION
string get_messages ([boolean $clear = true])
  • boolean $clear: Remove messages from the session
Constructor __construct (line 75)

Constructor

Override default component and align.

  • access: public
mr_html_notify __construct ([string $component = ''], [string $align = 'center'])
  • string $component: Default get string component
  • string $align: Default alignment
good (line 111)

Add a good message

  • access: public
mr_html_notify good (string $identifier, [mixed $a = NULL], [string $component = NULL], [string $align = NULL])
  • string $identifier: The string identifier to use in get_string()
  • mixed $a: To be passed in the call to get_string()
  • string $component: Get string component
  • string $align: Alignment of the message
set_align (line 97)

Set alignment

  • access: public
mr_html_notify set_align (string $align)
  • string $align: Alignment
set_component (line 86)

Set component string

  • access: public
mr_html_notify set_component (string $component)
  • string $component: Get string component
Class Constants
BAD = 'notifyproblem' (line 46)

Message that is bad

GOOD = 'notifysuccess' (line 51)

Message that is good

Documentation generated on Thu, 28 Jun 2012 16:33:49 -0700 by phpDocumentor 1.4.3