public function Yandex::formAttachGeocoder in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 modules/geolocation_yandex/src/Plugin/geolocation/Geocoder/Yandex.php \Drupal\geolocation_yandex\Plugin\geolocation\Geocoder\Yandex::formAttachGeocoder()
Attach geocoding logic to input element.
Parameters
array $render_array: Form containing the input element.
string $element_name: Name of the input element.
Return value
array|null Updated form element or NULL.
Overrides GeocoderBase::formAttachGeocoder
File
- modules/
geolocation_yandex/ src/ Plugin/ geolocation/ Geocoder/ Yandex.php, line 30
Class
- Yandex
- Provides the Yandex.
Namespace
Drupal\geolocation_yandex\Plugin\geolocation\GeocoderCode
public function formAttachGeocoder(array &$render_array, $element_name) {
parent::formAttachGeocoder($render_array, $element_name);
$render_array['#attached'] = BubbleableMetadata::mergeAttachments(empty($render_array['#attached']) ? [] : $render_array['#attached'], [
'drupalSettings' => [
'geolocation' => [
'geocoder' => [
$this
->getPluginId() => [],
],
],
],
]);
}