wiki/content/20201116131633-use_env_vars_in_route_conditions.md

19 lines
347 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-16
2024-05-06 20:40:05 +00:00
id: c7ac91f7-12f3-4c6c-b552-ba05c5206be9
title: Use Env Vars in Route Conditions
---
# Syntax
``` php
/**
* @Route("/new-feature", condition="env('bool:IS_FEATURE_ENABLED') === true")
*/
public function __invoke()
{
// this route will only execute when the value of the
// IS_FEATURE_ENABLED env var is TRUE
}
```