问题描述
嗨,我需要在 whmcs 中设置我家的导航栏('testhook')的类或 id
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimaryNavbar',1,function (MenuItem $primaryNavbar)
{
if (!is_null($primaryNavbar->getChild('Home'))) {
$primaryNavbar->getChild('Home')
->setID('testhook');
}
});
解决方法
更改 html id 属性似乎是不可能的,如何使用以下代码添加自定义类:
from scipy import stats
from scipy.stats import binom
def binomial():
n=4
p=0.6
k=0
prob =binom.pmf(k,n,p)
ans =round(1-prob,2)
#Round off to 2 decimal places
return ans