PHP Class UxWeb\SweetAlert\SweetAlertNotifier

Afficher le fichier Open project: uxweb/sweet-alert Class Usage Examples

Protected Properties

Свойство Type Description
$config array Configuration options.
$session UxWeb\SweetAlert\SessionStore

Méthodes publiques

Méthode Description
__construct ( UxWeb\SweetAlert\SessionStore $session ) Create a new SweetAlertNotifier instance.
autoclose ( integer $milliseconds = null ) : SweetAlertNotifier Set the duration for this alert until it autocloses.
basic ( string $text, string $title ) : SweetAlertNotifier Display a not typed alert message with a text and a title.
cancelButton ( $buttonText = 'Cancel' )
confirmButton ( string $buttonText = 'OK' ) : SweetAlertNotifier Add a confirmation button to the alert.
error ( string $text, string $title = '' ) : SweetAlertNotifier Display an error typed alert message with a text and an optional title.
getConfig ( ) : array Return the current alert configuration.
getJsonConfig ( ) : string Return the current alert configuration as Json.
html ( ) : SweetAlertNotifier Make Message HTML view.
info ( string $text, string $title = '' ) : SweetAlertNotifier Display an info typed alert message with a text and an optional title.
message ( string $text, string $title = '', string $type = null ) : SweetAlertNotifier Display an alert message with a text and an optional title.
persistent ( string $buttonText = 'OK' ) : SweetAlertNotifier Make this alert persistent with a confirmation button.
success ( string $text, string $title = '' ) : SweetAlertNotifier Display a success typed alert message with a text and an optional title.
warning ( string $text, string $title = '' ) : SweetAlertNotifier Display a warning typed alert message with a text and an optional title.

Méthodes protégées

Méthode Description
buildJsonConfig ( ) : string Build the configuration as Json.
flashConfig ( ) : void Flash the current alert configuration to the session store.
hasTitle ( ) : boolean Determine if the title is set.
removeTimer ( ) : void Remove the timer config option.
setDefaultConfig ( ) : void Sets all default config options for an alert.
switchTitle ( $config ) : void Switch the text message to the title key.

Method Details

__construct() public méthode

Create a new SweetAlertNotifier instance.
public __construct ( UxWeb\SweetAlert\SessionStore $session )
$session UxWeb\SweetAlert\SessionStore

autoclose() public méthode

Set the duration for this alert until it autocloses.
public autoclose ( integer $milliseconds = null ) : SweetAlertNotifier
$milliseconds integer
Résultat SweetAlertNotifier $this

basic() public méthode

Display a not typed alert message with a text and a title.
public basic ( string $text, string $title ) : SweetAlertNotifier
$text string
$title string
Résultat SweetAlertNotifier $this

buildJsonConfig() protected méthode

Build the configuration as Json.
protected buildJsonConfig ( ) : string
Résultat string

cancelButton() public méthode

public cancelButton ( $buttonText = 'Cancel' )

confirmButton() public méthode

Add a confirmation button to the alert.
public confirmButton ( string $buttonText = 'OK' ) : SweetAlertNotifier
$buttonText string
Résultat SweetAlertNotifier $this

error() public méthode

Display an error typed alert message with a text and an optional title.
public error ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Résultat SweetAlertNotifier $this

flashConfig() protected méthode

Flash the current alert configuration to the session store.
protected flashConfig ( ) : void
Résultat void

getConfig() public méthode

Return the current alert configuration.
public getConfig ( ) : array
Résultat array

getJsonConfig() public méthode

Return the current alert configuration as Json.
public getJsonConfig ( ) : string
Résultat string

hasTitle() protected méthode

Determine if the title is set.
protected hasTitle ( ) : boolean
Résultat boolean

html() public méthode

Make Message HTML view.
public html ( ) : SweetAlertNotifier
Résultat SweetAlertNotifier $this

info() public méthode

Display an info typed alert message with a text and an optional title.
public info ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Résultat SweetAlertNotifier $this

message() public méthode

By default the alert is not typed.
public message ( string $text, string $title = '', string $type = null ) : SweetAlertNotifier
$text string
$title string
$type string
Résultat SweetAlertNotifier $this

persistent() public méthode

Make this alert persistent with a confirmation button.
public persistent ( string $buttonText = 'OK' ) : SweetAlertNotifier
$buttonText string
Résultat SweetAlertNotifier $this

removeTimer() protected méthode

Remove the timer config option.
protected removeTimer ( ) : void
Résultat void

setDefaultConfig() protected méthode

Sets all default config options for an alert.
protected setDefaultConfig ( ) : void
Résultat void

success() public méthode

Display a success typed alert message with a text and an optional title.
public success ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Résultat SweetAlertNotifier $this

switchTitle() protected méthode

Switch the text message to the title key.
protected switchTitle ( $config ) : void
Résultat void

warning() public méthode

Display a warning typed alert message with a text and an optional title.
public warning ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Résultat SweetAlertNotifier $this

Property Details

$config protected_oe property

Configuration options.
protected array $config
Résultat array

$session protected_oe property

protected SessionStore,UxWeb\SweetAlert $session
Résultat UxWeb\SweetAlert\SessionStore