本文整理匯總了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];
}