class Country extends LocalizedList
{
- protected static $_listPath = 'vendor/umpirsky/country-list/data/$locale/country.php';
+ protected static function _getListPath(){
+ return 'vendor/umpirsky/country-list/data/$locale/country.php';
+ }
}
class Locale extends LocalizedList
{
- protected static $_listPath = 'vendor/umpirsky/locale-list/data/$locale/locales.php';
+
+ protected static function _getListPath()
+ {
+ return 'vendor/umpirsky/locale-list/data/$locale/locales.php';
+ }
}
public static function getList($locale)
{
- if (!isset(self::$_rawList[$locale])) {
- self::$_rawList[$locale] = static::_getList($locale);
+ if (!isset(static::$_rawList[$locale])) {
+ static::$_rawList[$locale] = static::_getList($locale);
}
- return self::$_rawList[$locale];
+ return static::$_rawList[$locale];
+ }
+
+ protected static function _getListPath()
+ {
+ return '';
}
/**
*/
protected static function _getList($locale)
{
- $f = base_path(str_replace('$locale', $locale, self::$_listPath));
+ $f = base_path(str_replace('$locale', $locale, static::_getListPath()));
if (!file_exists($f) || !is_file($f)) {
return [];
}