public function FormHelper::createAjaxButton in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/Services/FormHelper.php \Drupal\filebrowser\Services\FormHelper::createAjaxButton()
1 call to FormHelper::createAjaxButton()
- FormHelper::createActionBar in src/
Services/ FormHelper.php
File
- src/
Services/ FormHelper.php, line 88
Class
- FormHelper
- Class FormHelper Service that provides utilities to forms
Namespace
Drupal\filebrowser\ServicesCode
public function createAjaxButton($action) {
return [
'#type' => 'submit',
'#return_value' => $action['operation'],
'#value' => $action['title'],
'#name' => $action['operation'],
'#title' => $action['title'],
'#attributes' => [
'class' => [
'use-ajax-submit',
],
],
'#validate' => [
'::ajaxValidate',
],
];
}