public function FieldController::manageRedirect in Display Suite 8.3
Same name and namespace in other branches
- 8.4 src/Controller/FieldController.php \Drupal\ds\Controller\FieldController::manageRedirect()
- 8.2 src/Controller/FieldController.php \Drupal\ds\Controller\FieldController::manageRedirect()
Redirect to the correct manage callback.
1 string reference to 'FieldController::manageRedirect'
File
- src/
Controller/ FieldController.php, line 123
Class
- FieldController
- Route controller fields.
Namespace
Drupal\ds\ControllerCode
public function manageRedirect($field_key) {
$config = $this
->config('ds.field.' . $field_key);
if ($field = $config
->get()) {
$url = new Url('ds.manage_' . $field['type'] . '_field', [
'field_key' => $field_key,
]);
if ($url
->toString()) {
return new RedirectResponse($url
->toString());
}
}
$this
->messenger()
->addMessage($this
->t('Field not found'));
$url = new Url('ds.fields_list');
return new RedirectResponse($url
->toString());
}