Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
phonenumber.php
1<?php
9
10use Bitrix\Main;
11
13{
14 public function getCountriesAction()
15 {
16 $countries = GetCountries();
17 $defaultCountry = Main\PhoneNumber\Parser::getDefaultCountry();
18 usort($countries, function($a, $b) use ($defaultCountry)
19 {
20 return ($a['CODE'] === $defaultCountry) ? -1 : $a['NAME'] <=> $b['NAME'];
21 });
22 return $countries;
23 }
24
25 public function configureActions()
26 {
27 return [
28 'getCountries' => [
29 '-prefilters' => [
30 Main\Engine\ActionFilter\Authentication::class,
31 ],
32 ],
33 ];
34 }
35}