public function SubmitButtonRedirect::configurationForm in Flexiform 8
The configuration form.
Parameters
array $form: The form array.
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
Return value
array The form with any additions.
Overrides ConfigurableFormEnhancerInterface::configurationForm
File
- src/
Plugin/ FormEnhancer/ SubmitButtonRedirect.php, line 64
Class
- SubmitButtonRedirect
- FormEnhancer for altering the redirects of submit buttons.
Namespace
Drupal\flexiform\Plugin\FormEnhancerCode
public function configurationForm(array $form, FormStateInterface $form_state) {
foreach ($this
->locateSubmitButtons() as $path => $label) {
$original_path = $path;
$path = str_replace('][', '::', $path);
$form['redirect'][$path] = [
'#type' => 'textfield',
'#title' => $this
->t('@label Button Redirect Path', [
'@label' => $label,
]),
'#description' => 'Array Parents: ' . $original_path,
'#default_value' => !empty($this->configuration[$path]) ? $this->configuration[$path] : '',
];
}
return $form;
}