/** * Retrieve option array with allowed countries * * @return array */ public function toOptionArray() { $_allowed = $this->_config->getAllowedCountries(); $result = []; foreach ($_allowed as $iso => $info) { $result[] = ['value' => $iso, 'label' => $info['name']]; } return $result; }
/** * Get allowed country names array * * @return array */ protected function _getCountriesArray() { $_allowed = $this->_config->getAllowedCountries(); $result = []; foreach ($_allowed as $iso => $info) { $result[$iso] = $info['name']; } return $result; }