本文整理汇总了PHP中CList::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CList::__construct方法的具体用法?PHP CList::__construct怎么用?PHP CList::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($id = null)
{
parent::__construct();
$this->addClass('table-forms');
if ($id) {
$this->setId(zbx_formatDomId($id));
}
}
示例2: __construct
public function __construct($name, $value)
{
parent::__construct();
$this->name = $name;
$this->value = $value;
$this->orientation = self::ORIENTATION_HORIZONTAL;
$this->enabled = true;
$this->values = [];
$this->modern = false;
$this->setId(zbx_formatDomId($name));
}
示例3: __construct
/**
* @param string $options['name']
* @param int $options['value'] (optional) Default: TRIGGER_SEVERITY_NOT_CLASSIFIED
* @param bool $options['all'] (optional)
*/
public function __construct(array $options = [])
{
parent::__construct();
$id = zbx_formatDomId($options['name']);
$this->addClass(ZBX_STYLE_RADIO_SEGMENTED);
$this->setId($id);
if (!array_key_exists('value', $options)) {
$options['value'] = TRIGGER_SEVERITY_NOT_CLASSIFIED;
}
$severity_from = array_key_exists('all', $options) && $options['all'] ? -1 : TRIGGER_SEVERITY_NOT_CLASSIFIED;
$config = select_config();
for ($severity = $severity_from; $severity < TRIGGER_SEVERITY_COUNT; $severity++) {
$name = $severity == -1 ? _('all') : getSeverityName($severity, $config);
$class = $severity == -1 ? null : getSeverityStyle($severity);
$radio = (new CInput('radio', $options['name'], $severity))->setId(zbx_formatDomId($options['name'] . '_' . $severity));
if ($severity === $options['value']) {
$radio->setAttribute('checked', 'checked');
}
parent::addItem((new CListItem([$radio, new CLabel($name, $options['name'] . '_' . $severity)]))->addClass($class));
}
}
示例4: __construct
/**
* Creates a UL horizontal list with spaces between elements.
*
* @param array $values an array of items to add to the list
*/
public function __construct(array $values = [])
{
parent::__construct($values);
$this->addClass(ZBX_STYLE_HOR_LIST);
}