protected function WebformEntityAjaxFormTrait::actions in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Form/WebformEntityAjaxFormTrait.php \Drupal\webform\Form\WebformEntityAjaxFormTrait::actions()
File
- src/
Form/ WebformEntityAjaxFormTrait.php, line 81
Class
- WebformEntityAjaxFormTrait
- Trait for webform entity ajax support.
Namespace
Drupal\webform\FormCode
protected function actions(array $form, FormStateInterface $form_state) {
$actions = parent::actions($form, $form_state);
if (!$this
->getEntity()
->isNew() && !$this
->isDialogDisabled()) {
$actions['reset'] = [
'#type' => 'submit',
'#value' => $this
->t('Reset'),
'#submit' => [
'::noSubmit',
],
'#validate' => [
'::noSubmit',
],
'#attributes' => [
'class' => [
'webform-ajax-refresh',
],
],
'#weight' => 100,
];
}
return $actions;
}