Deploy on 2026-06-05 16:08:53

This commit is contained in:
Hamza-Ayed
2026-06-05 16:08:53 +03:00
parent c0da60069f
commit 54065628bf
12 changed files with 316 additions and 167 deletions

View File

@@ -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);