PHP Class Basecoat\Messages

Author: Brent Baisley ([email protected])
Afficher le fichier Open project: shutterstock/basecoat

Protected Properties

Свойство Type Description
$tpl_file Template file to use for message output

Méthodes publiques

Méthode Description
__construct ( ) : Object Create an instance of the Message class
clear ( String $msg_type = null ) : integer Clear all currently loaded messages
display ( $view, boolean $clear = true ) : integer Add current messages to the page for output
error ( $message ) Add an error type message to output
get ( String $msg_type = null ) : Array Get currently loaded messages Optionally filter on message type
info ( $message ) Add an information type message to output
setTemplate ( String $tpl_file ) Set the template file to use for message output
warn ( $message ) Add an warning type message to output

Méthodes protégées

Méthode Description
add ( String $type, String $message ) : integer Add a message of the specified type

Method Details

__construct() public méthode

Create an instance of the Message class
public __construct ( ) : Object
Résultat Object instance of Message class

add() protected méthode

Messages are stored in the SESSION so they persist until they are outputted to the page
protected add ( String $type, String $message ) : integer
$type String message type to add
$message String message to add
Résultat integer current number of messages of the specified type

clear() public méthode

Clear all currently loaded messages
public clear ( String $msg_type = null ) : integer
$msg_type String optionally clear only messages of specified type (default is to clear all)
Résultat integer number of messages cleared

display() public méthode

Add current messages to the page for output
public display ( $view, boolean $clear = true ) : integer
$clear boolean clear messages after added to output
Résultat integer number of messages added to output

error() public méthode

Add an error type message to output
public error ( $message )

get() public méthode

Get currently loaded messages Optionally filter on message type
public get ( String $msg_type = null ) : Array
$msg_type String message type to return (info, warn, error)
Résultat Array list of currently loaded messages

info() public méthode

Add an information type message to output
public info ( $message )

setTemplate() public méthode

Set the template file to use for message output
public setTemplate ( String $tpl_file )
$tpl_file String path to the template file to load

warn() public méthode

Add an warning type message to output
public warn ( $message )

Property Details

$tpl_file protected_oe property

Template file to use for message output
protected $tpl_file