如何仅在特定页面上使用 WHMCS 中的挂钩?

How to use hook in WHMCS only on specific page?

如果我只想在联属网络营销页面 (affiliates.php) 上显示侧边菜单,而不是将代码包含在:

if (App::getCurrentFilename() == 'affiliates'){

}

但是如何对页面 index.php?m=somepage 做同样的事情?

您可以使用 php 内置变量来获取 URI,但是如果您想使用应用程序对象来获取特定参数,您可以执行以下操作:

$whmcs = App::self();
$module = $whmcs->get_req_var('m');