mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-24 20:46:22 +00:00
18 lines
347 B
Markdown
18 lines
347 B
Markdown
---
|
|
date: 2020-11-16
|
|
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
|
|
}
|
|
```
|