feat: domain-based theme-detection

This commit is contained in:
Björn Fromme
2026-01-27 11:18:37 +01:00
parent 2355442ac0
commit d5944bf717
9 changed files with 189 additions and 38 deletions
+6 -4
View File
@@ -5,10 +5,10 @@ declare(strict_types=1);
namespace App\Twig;
use App\BusProNet\DataProvider\CountryDataProvider;
use App\EventListener\DomainThemeListener;
use App\Form\Model\BookingDto;
use App\Form\Service\CreateFieldStateProvider;
use App\Form\Service\EditFieldStateProvider;
use App\Service\BookingService;
use App\Service\ParticipantEligibilityService;
use Symfony\Component\Form\FormView;
use Symfony\Component\HttpFoundation\RequestStack;
@@ -228,18 +228,20 @@ class AppRuntime implements RuntimeExtensionInterface
}
/**
* Returns the current booking theme from session.
* Returns the current booking theme from request attribute.
*
* The theme is resolved by DomainThemeListener based on the request host.
* Defaults to 'base' if no theme is set.
*/
public function getBookingTheme(): string
{
$request = $this->requestStack->getCurrentRequest();
if (null === $request) {
return BookingService::DEFAULT_THEME;
return 'base';
}
return $request->getSession()->get(BookingService::THEME_KEY, BookingService::DEFAULT_THEME);
return $request->attributes->get(DomainThemeListener::THEME_ATTRIBUTE, 'base');
}
/**