Overrides Drupal\Core\Entity\EntityFormController::form().
Overrides EntityFormController::form
public function form(array $form, array &$form_state) {
$form = parent::form($form, $form_state);
$entity = $this->entity;
$form['label'] = array(
'#type' => 'textfield',
'#title' => 'Label',
'#default_value' => $entity
->label(),
'#required' => TRUE,
);
$form['id'] = array(
'#type' => 'machine_name',
'#default_value' => $entity
->id(),
'#required' => TRUE,
'#machine_name' => array(
'exists' => 'config_test_load',
),
);
$form['weight'] = array(
'#type' => 'weight',
'#title' => 'Weight',
'#default_value' => $entity
->get('weight'),
);
$form['style'] = array(
'#type' => 'select',
'#title' => 'Image style',
'#options' => array(),
'#default_value' => $entity
->get('style'),
'#access' => FALSE,
);
if (module_exists('image')) {
$form['style']['#access'] = TRUE;
$form['style']['#options'] = image_style_options();
}
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => 'Delete',
);
return $form;
}