protected function ModuleBuilderComponentFormBase::getNextLink in Module Builder 7.2
Get the next entity link after the one for the current form.
Return value
The name of an entity link.
2 calls to ModuleBuilderComponentFormBase::getNextLink()
- ModuleBuilderComponentFormBase::actions in includes/
module_builder.form.inc - Returns an array of supported actions for the current entity form.
- ModuleBuilderComponentFormBase::save in includes/
module_builder.form.inc
File
- includes/
module_builder.form.inc, line 853
Class
- ModuleBuilderComponentFormBase
- Backport of ComponentFormBase from 8.x-3.x version.
Code
protected function getNextLink() {
// Probably a more elegant way of figuring out where we currently are
// with routes maybe?
$operation = $this
->getOperation();
// Special case for add and edit forms.
if ($operation == 'default' || $operation == 'edit') {
$operation = 'name';
}
$handler_class = $this->entityTypeManager
->getHandler('module_builder_module', 'component_sections');
$form_ops = $handler_class
->getFormOperations();
// Add in the 'name' operation, as the handler doesn't return it.
$form_ops = array_merge([
'name',
], $form_ops);
$index = array_search($operation, $form_ops);
return $form_ops[$index + 1] . '-form';
}