本文整理汇总了PHP中Element::alter_class_names方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::alter_class_names方法的具体用法?PHP Element::alter_class_names怎么用?PHP Element::alter_class_names使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element::alter_class_names方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: alter_class_names
/**
* Adds the 'fit-content' class name if the {@link FIT_CONTENT} attribute is truthy.
*/
protected function alter_class_names(array $class_names)
{
$class_names = parent::alter_class_names($class_names);
if ($this[self::FIT_CONTENT]) {
$class_names['fit-content'] = true;
}
return $class_names;
}
示例2: alter_class_names
/**
* Adds the `no-legend` class name if the group has no legend (the {@link LEGEND} attribute
* is empty).
*
* @inheritdoc
*/
protected function alter_class_names(array $class_names)
{
$name = $this['name'];
return parent::alter_class_names($class_names) + ['group' => true, 'group-name' => $name ? 'group--' . normalize($name) : null, 'no-legend' => !$this[self::LEGEND]];
}
示例3: alter_class_names
protected function alter_class_names(array $class_names)
{
return parent::alter_class_names($class_names) + ['modal' => true, 'hide' => true, 'fade' => true];
}
示例4: alter_class_names
/**
* Adds the following class names:
*
* - `listview`
*
* @inheritdoc
*/
protected function alter_class_names(array $class_names)
{
return parent::alter_class_names($class_names) + ['listview' => true];
}