curr_style = $cfg->get('map_style'); parent::__construct([ HiddenField::create($latitudeField) ->setAttribute('data-mapbox-field', 'Latitude'), HiddenField::create($longitudeField) ->setAttribute('data-mapbox-field', 'Longitude') ]); $this->setName($name); $this->setTitle($title); } public function getAttributes() { $attrs = parent::getAttributes(); return array_merge($attrs, [ 'class' => $attrs['class'].' stacked', 'data-style' => $this->getStyle(), ]); } public function getStyle() { return $this->curr_style; } public function setStyle($style) { $this->curr_style = $style; return $this; } }