本文整理汇总了PHP中CheckboxField::performDisabledTransformation方法的典型用法代码示例。如果您正苦于以下问题:PHP CheckboxField::performDisabledTransformation方法的具体用法?PHP CheckboxField::performDisabledTransformation怎么用?PHP CheckboxField::performDisabledTransformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckboxField
的用法示例。
在下文中一共展示了CheckboxField::performDisabledTransformation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performDisabledTransformation
/**
* Return a disabled version of this field. Keeps the composition but returns disabled
* versions of all the child {@link FormField} objects.
*
* @return CompositeField
*/
public function performDisabledTransformation()
{
parent::performDisabledTransformation();
$newChildren = new FieldList();
$clone = clone $this;
if ($clone->getChildren()) {
foreach ($clone->getChildren() as $idx => $child) {
if (is_object($child)) {
$child = $child->transform(new DisabledTransformation());
}
$newChildren->push($child, $idx);
}
}
$clone->children = $newChildren;
$clone->readonly = true;
$clone->addExtraClass($this->extraClass());
$clone->setDescription($this->getDescription());
foreach ($this->attributes as $k => $v) {
$clone->setAttribute($k, $v);
}
return $clone;
}