當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP WHMCS ClientAlert用法及代碼示例

在定義客戶端警報時執行

參數

變量 類型 注意
N/A \WHMCS\User\Client 客戶端模型

響應

返回一個新的警報對象進行渲染。

示例代碼

<?php

use WHMCS\User\Alert;

add_hook('ClientAlert', 1, function($client) {
    $firstName = $client->firstName;
    $lastName = $client->lastName;
    return new Alert(
        "This is a test notification for {$firstName} {$lastName}",
        'info' //see http://getbootstrap.com/components/#alerts
    );
});

相關用法


注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 ClientAlert。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。