Deploy on 2026-06-05 16:08:53
This commit is contained in:
@@ -24,6 +24,18 @@ abstract class Controller
|
||||
throw new \Exception("View template {$view} not found.");
|
||||
}
|
||||
|
||||
// Automatically inject current language, translation array, and authenticated user
|
||||
$lang = $this->session->get('lang', 'en');
|
||||
$langFile = __DIR__ . "/../../resources/lang/{$lang}.php";
|
||||
$t = file_exists($langFile) ? require $langFile : [];
|
||||
$user = \App\Core\App::$app->request->routeParam('_authenticated_user');
|
||||
|
||||
$data = array_merge([
|
||||
'lang' => $lang,
|
||||
't' => $t,
|
||||
'user' => $user,
|
||||
], $data);
|
||||
|
||||
// Extract variables to local scope
|
||||
extract($data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user