Browse Source

init locale model #14

main
ghost 1 year ago
parent
commit
5e31e0e972
  1. 24
      src/app/model/locale.php

24
src/app/model/locale.php

@ -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…
Cancel
Save