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


PHP WHMCS ClientAreaHomepagePanels用法及代碼示例

在呈現客戶區主頁麵板之前執行。這可用於操作和添加其他麵板。有關使用主頁麵板的更多信息以及更多示例,請參閱Working with ClientArea Homepage Panels

參數

變量 類型 注意
item \WHMCS\View\Menu\Item

響應

不支持響應

示例代碼

<?php

add_hook('ClientAreaHomepagePanels', 1, function($homePagePanels) {
    $newPanel = $homePagePanels->addChild(
        'unique-css-name',
        array(
            'name' => 'Friendly Name',
            'label' => 'Translated Language String',
            'icon' => 'fas fa-calendar-alt', //see http://fortawesome.github.io/Font-Awesome/icons/
            'order' => '99',
            'extras' => array(
                'color' => 'pomegranate', //see Panel Accents in template styles.css
                'btn-link' => 'https://www.whmcs.com',
                'btn-text' => Lang::trans('go'),
                'btn-icon' => 'fas fa-arrow-right',
            ),
        )
    );
// Repeat as needed to add enough children
    $newPanel->addChild(
        'unique-css-name-id1',
        array(
            'label' => 'Panel Row Text Goes Here',
            'uri' => 'index.php?m=yourmodule',
            'order' => 10,
        )
    );
});

相關用法


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