我需要在我的 select.genericlist 中添加一个 select.optgroup,这是我的代码:
foreach ($this->methods as $method) {
if ($this->checkConditions($cart, $method, $cart->pricesUnformatted)) {
$methodSalesPrice = $this->calculateSalesPrice($cart, $method, $cart->pricesUnformatted);
$method->$method_name = $this->renderPluginName($method);
$session = JFactory::getSession();
$htmlI[] = $this->getPluginHtml($method, $selected, $methodSalesPrice);
// this is my attempt
$htmlI[] = JHTML::_('Select.optgroup', 'My optgroup');
// my attempt ends here
$htmlI[] = JHTML::_('Select.genericlist', $this->banks, 'service_issuer', 'size=1', 'key', 'value', $session->get('service_issuer', 0, 'vm'));
$html[] = $htmlI;
}
}
这将返回以下内容:
array
有没有人这样做过?非常感谢您的建议