feat: domain-based theme-detection
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user