ghost
1 year ago
1 changed files with 24 additions and 0 deletions
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
<?php |
||||
|
||||
class AppModelLocale { |
||||
|
||||
private $_locales = []; |
||||
|
||||
public function __construct(object $locales) |
||||
{ |
||||
foreach ($locales as $key => $value) |
||||
{ |
||||
$this->_locales[] = (object) |
||||
[ |
||||
'key' => $key, |
||||
'value' => $value[0], |
||||
'active' => false !== stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $key) ? true : false, |
||||
]; |
||||
} |
||||
} |
||||
|
||||
public function getLocales() : object |
||||
{ |
||||
return $this->_locales; |
||||
} |
||||
} |
Loading…
Reference in new issue