Initial import
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace app\services;
|
||||
|
||||
class UrlReg {
|
||||
public static function generate() {
|
||||
if(!empty(\Yii::$app->params['locale_switch'])){
|
||||
$localeSwitch = \Yii::$app->params['locale_switch'];
|
||||
return (object)[
|
||||
'locale' => \Yii::$app->language == 'bg' ? 'en' : 'bg',
|
||||
'uri' => $localeSwitch[\Yii::$app->language]
|
||||
];
|
||||
} else {
|
||||
echo 'Local switch is empty';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user