public function FieldController::manageRedirect in Display Suite 8.2
Same name and namespace in other branches
- 8.4 src/Controller/FieldController.php \Drupal\ds\Controller\FieldController::manageRedirect()
- 8.3 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 121
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', array(
'field_key' => $field_key,
));
if ($url
->toString()) {
return new RedirectResponse($url
->toString());
}
}
drupal_set_message($this
->t('Field not found'));
$url = new Url('ds.fields_list');
return new RedirectResponse($url
->toString());
}