2024.8.23
Loading...
Searching...
No Matches
class.action.switchLang.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: Bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
10
/**
11
* Class ActionSwitchLang
12
*
13
* This class handles the action of switching the language configuration for the Bearsampp application.
14
*/
15
class
ActionSwitchLang
16
{
17
/**
18
* ActionSwitchLang constructor.
19
*
20
* @param array $args An array of arguments where the first element is expected to be the new language code.
21
*/
22
public
function
__construct
($args)
23
{
24
global
$bearsamppConfig
;
25
26
// Check if the first argument is set and not empty, then replace the language configuration.
27
if
(isset($args[0]) && !empty($args[0])) {
28
$bearsamppConfig
->replace(
Config::CFG_LANG
, $args[0]);
29
}
30
}
31
}
ActionSwitchLang
Definition
class.action.switchLang.php:16
ActionSwitchLang\__construct
__construct($args)
Definition
class.action.switchLang.php:22
Config\CFG_LANG
const CFG_LANG
Definition
class.config.php:20
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:26
Bearsampp-development
sandbox
core
classes
actions
class.action.switchLang.php
Generated by
1.11.0