flagception-bundle icon indicating copy to clipboard operation
flagception-bundle copied to clipboard

Enable service for symfony routing condition option

Open tacman opened this issue 2 years ago • 0 comments

The latest version of Symfony allows the routing condition to access a service, so developers can write:

    #[Route('/demo', name: 'app_demo', condition: "service('flagception.manager.feature_manager').isActive('beta')")]
    public function demo(): Response
    {
        return $this->render('app/index.html.twig', [
            'controller_name' => 'Demo',
        ]);
    }

I'll submit a PR to tag the service so it can be used this way.

tacman avatar Jun 09 '22 14:06 tacman