public static function ConfigEntityRevisionFields::addRevisionFormFields in Config Entity Revisions 8
Same name and namespace in other branches
- 8.2 src/ConfigEntityRevisionFields.php \Drupal\config_entity_revisions\ConfigEntityRevisionFields::addRevisionFormFields()
- 1.x src/ConfigEntityRevisionFields.php \Drupal\config_entity_revisions\ConfigEntityRevisionFields::addRevisionFormFields()
Adds the revision form fields to the form.
Parameters
&$form: The form to which the fields should be added.
Overrides ConfigEntityRevisionFieldsInterface::addRevisionFormFields
File
- src/
ConfigEntityRevisionFields.php, line 22
Class
Namespace
Drupal\config_entity_revisionsCode
public static function addRevisionFormFields(&$form) {
// Add a log field if the "Create new revision" option is checked, or if the
// current user has the ability to check that option.
$new_revision_default = self::getNewRevisionDefault();
$form['revision'] = [
'#type' => 'checkbox',
'#title' => t('Create new revision'),
'#default_value' => $new_revision_default,
'#group' => 'revision_information',
];
}