public static function LeafletMap::optionsFormEntitySourceSubmit in Leaflet 8
Same name and namespace in other branches
- 2.1.x modules/leaflet_views/src/Plugin/views/style/LeafletMap.php \Drupal\leaflet_views\Plugin\views\style\LeafletMap::optionsFormEntitySourceSubmit()
- 2.0.x modules/leaflet_views/src/Plugin/views/style/LeafletMap.php \Drupal\leaflet_views\Plugin\views\style\LeafletMap::optionsFormEntitySourceSubmit()
Submit to update the data source.
Parameters
array $form: The Form.
\Drupal\Core\Form\FormStateInterface $form_state: The Form state.
File
- modules/
leaflet_views/ src/ Plugin/ views/ style/ LeafletMap.php, line 636
Class
- LeafletMap
- Style plugin to render a View output as a Leaflet map.
Namespace
Drupal\leaflet_views\Plugin\views\styleCode
public static function optionsFormEntitySourceSubmit(array $form, FormStateInterface $form_state) {
$parents = $form_state
->getTriggeringElement()['#parents'];
array_pop($parents);
array_push($parents, 'entity_source');
// Set the data source selected in the form state and rebuild the form.
$form_state
->set('entity_source', $form_state
->getValue($parents));
$form_state
->setRebuild(TRUE);
}