protected function MoveBlockForm::getSelectedDelta in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Form/MoveBlockForm.php \Drupal\layout_builder\Form\MoveBlockForm::getSelectedDelta()
Gets the selected delta.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
Return value
int The section delta.
2 calls to MoveBlockForm::getSelectedDelta()
- MoveBlockForm::buildForm in core/
modules/ layout_builder/ src/ Form/ MoveBlockForm.php - Builds the move block form.
- MoveBlockForm::submitForm in core/
modules/ layout_builder/ src/ Form/ MoveBlockForm.php - Form submission handler.
File
- core/
modules/ layout_builder/ src/ Form/ MoveBlockForm.php, line 308
Class
- MoveBlockForm
- Provides a form for moving a block.
Namespace
Drupal\layout_builder\FormCode
protected function getSelectedDelta(FormStateInterface $form_state) {
if ($form_state
->hasValue('region')) {
return (int) explode(':', $form_state
->getValue('region'))[0];
}
return (int) $this->delta;
}