PHP Класс UxWeb\SweetAlert\SweetAlertNotifier

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config array Configuration options.
$session UxWeb\SweetAlert\SessionStore

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

autoclose() публичный Метод

Set the duration for this alert until it autocloses.
public autoclose ( integer $milliseconds = null ) : SweetAlertNotifier
$milliseconds integer
Результат SweetAlertNotifier $this

basic() публичный Метод

Display a not typed alert message with a text and a title.
public basic ( string $text, string $title ) : SweetAlertNotifier
$text string
$title string
Результат SweetAlertNotifier $this

buildJsonConfig() защищенный Метод

Build the configuration as Json.
protected buildJsonConfig ( ) : string
Результат string

cancelButton() публичный Метод

public cancelButton ( $buttonText = 'Cancel' )

confirmButton() публичный Метод

Add a confirmation button to the alert.
public confirmButton ( string $buttonText = 'OK' ) : SweetAlertNotifier
$buttonText string
Результат SweetAlertNotifier $this

error() публичный Метод

Display an error typed alert message with a text and an optional title.
public error ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Результат SweetAlertNotifier $this

flashConfig() защищенный Метод

Flash the current alert configuration to the session store.
protected flashConfig ( ) : void
Результат void

getConfig() публичный Метод

Return the current alert configuration.
public getConfig ( ) : array
Результат array

getJsonConfig() публичный Метод

Return the current alert configuration as Json.
public getJsonConfig ( ) : string
Результат string

hasTitle() защищенный Метод

Determine if the title is set.
protected hasTitle ( ) : boolean
Результат boolean

html() публичный Метод

Make Message HTML view.
public html ( ) : SweetAlertNotifier
Результат SweetAlertNotifier $this

info() публичный Метод

Display an info typed alert message with a text and an optional title.
public info ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Результат SweetAlertNotifier $this

message() публичный Метод

By default the alert is not typed.
public message ( string $text, string $title = '', string $type = null ) : SweetAlertNotifier
$text string
$title string
$type string
Результат SweetAlertNotifier $this

persistent() публичный Метод

Make this alert persistent with a confirmation button.
public persistent ( string $buttonText = 'OK' ) : SweetAlertNotifier
$buttonText string
Результат SweetAlertNotifier $this

removeTimer() защищенный Метод

Remove the timer config option.
protected removeTimer ( ) : void
Результат void

setDefaultConfig() защищенный Метод

Sets all default config options for an alert.
protected setDefaultConfig ( ) : void
Результат void

success() публичный Метод

Display a success typed alert message with a text and an optional title.
public success ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Результат SweetAlertNotifier $this

switchTitle() защищенный Метод

Switch the text message to the title key.
protected switchTitle ( $config ) : void
Результат void

warning() публичный Метод

Display a warning typed alert message with a text and an optional title.
public warning ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
Результат SweetAlertNotifier $this

Описание свойств

$config защищенное свойство

Configuration options.
protected array $config
Результат array

$session защищенное свойство

protected SessionStore,UxWeb\SweetAlert $session
Результат UxWeb\SweetAlert\SessionStore