PHP 클래스 Piwik\Notification

UI notifications are messages displayed to the user near the top of the screen. Notifications consist of a message, a context (the message type), a priority and a display type. **The context** affects the way the message looks, but not how it is displayed. **The display type** determines how the message is displayed. **The priority** determines where it is shown in the list of all displayed notifications. ### Examples **Display an error message** $notification = new Notification('My Error Message'); $notification->context = Notification::CONTEXT_ERROR; Notification\Manager::notify('myUniqueNotificationId', $notification); **Display a temporary success message** $notification = new Notificiation('Success'); $notification->context = Notification::CONTEXT_SUCCESS; $notification->type = Notification::TYPE_TOAST; Notification\Manager::notify('myUniqueNotificationId', $notification); **Display a message near the top of the screen** $notification = new Notification('Urgent: Your password has expired!'); $notification->context = Notification::CONTEXT_INFO; $notification->type = Notification::TYPE_PERSISTENT; $notification->priority = Notification::PRIORITY_MAX;
파일 보기 프로젝트 열기: piwik/piwik

공개 프로퍼티들

프로퍼티 타입 설명
$context string A notification's context determines how it will be styled.
$flags integer Usage: $notification->flags = Notification::FLAG_BAR | Notification::FLAG_FOO.
$message string The notification message. Must be set.
$priority integer The notification's priority. The higher the priority, the higher the order. See PRIORITY_* constants in {@link Notification} to see possible priority values.
$raw boolean If true, the message will not be escaped before being outputted as HTML. If you set this to true, make sure you escape text yourself in order to avoid XSS vulnerabilities.
$title string The notification title. The title is optional and is displayed directly before the message content.
$type string The notification's display type. See TYPE_* constants in {@link Notification}.

공개 메소드들

메소드 설명
__construct ( string $message ) Constructor.
getPriority ( ) : integer Returns the notification's priority. If no priority has been set, a priority will be set based on the notification's context.
hasNoClear ( ) : integer Returns 1 if the notification will be displayed without a close button, 0 if otherwise.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $message )
$message string The notification message.

getPriority() 공개 메소드

Returns the notification's priority. If no priority has been set, a priority will be set based on the notification's context.
public getPriority ( ) : integer
리턴 integer

hasNoClear() 공개 메소드

Returns 1 if the notification will be displayed without a close button, 0 if otherwise.
public hasNoClear ( ) : integer
리턴 integer `1` or `0`.

프로퍼티 상세

$context 공개적으로 프로퍼티

A notification's context determines how it will be styled.
public string $context
리턴 string

$flags 공개적으로 프로퍼티

Usage: $notification->flags = Notification::FLAG_BAR | Notification::FLAG_FOO.
public int $flags
리턴 integer

$message 공개적으로 프로퍼티

The notification message. Must be set.
public string $message
리턴 string

$priority 공개적으로 프로퍼티

The notification's priority. The higher the priority, the higher the order. See PRIORITY_* constants in {@link Notification} to see possible priority values.
public int $priority
리턴 integer

$raw 공개적으로 프로퍼티

If true, the message will not be escaped before being outputted as HTML. If you set this to true, make sure you escape text yourself in order to avoid XSS vulnerabilities.
public bool $raw
리턴 boolean

$title 공개적으로 프로퍼티

The notification title. The title is optional and is displayed directly before the message content.
public string $title
리턴 string

$type 공개적으로 프로퍼티

The notification's display type. See TYPE_* constants in {@link Notification}.
public string $type
리턴 string