countryCollectionFactory = $countryCollectionFactory; } /** * Get a country list * return array */ private function getCountriesList() { return $this->countryCollectionFactory->create()->addOrder('name', 'asc')->getItems(); } /** * @inheritdoc */ public function getJsLayout() { $countries = []; foreach ($this->getCountriesList() as $country) { $countries[] = [ 'dial_code' => $country->getDialCode(), 'name' => $country->getName(), ]; } $this->jsLayout['components']['msp-twofactorauth-configure']['children']['register']['configurePostUrl'] = $this->getUrl('*/*/configurepost'); $this->jsLayout['components']['msp-twofactorauth-configure']['children']['verify']['verifyPostUrl'] = $this->getUrl('*/*/configureverifypost'); $this->jsLayout['components']['msp-twofactorauth-configure']['children']['verify']['successUrl'] = $this->getUrl($this->_urlBuilder->getStartupPageUrl()); $this->jsLayout['components']['msp-twofactorauth-configure']['children']['register']['countries'] = $countries; return parent::getJsLayout(); } }