From f864f6e6ae9c423f22e88a980e9a813215547f5b Mon Sep 17 00:00:00 2001 From: Michel Chowanski Date: Tue, 10 Apr 2018 22:33:08 +0200 Subject: [PATCH] #26 Add feature name advice --- CHANGELOG.md | 7 +++++++ docs/usage.md | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fcb8f..4eb9ab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## Unreleased +### Fix +- \#27 Fix route xml in documentation @migo315 + +### Added +- \#26 Add feature name advice in documentation @migo315 + ## [3.0.1] ### Fix - Add service alias for `Flagception\Manager\FeatureManagerInterface` for fixing autowiring @hanishsingla diff --git a/docs/usage.md b/docs/usage.md index ceebf45..5b36a5d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -116,6 +116,12 @@ If you request an action with inactive feature flag, you will get a `NotFoundHtt Take a look to the detail documentation for [Twig](twig.md), [Route](route.md) or [Annotation](annotation.md) usage. +##### Feature names +You can name your features as you like. But we recommend using [snake case](https://en.wikipedia.org/wiki/Snake_case). +Especially because Symfony normalizes values from your YML or XML into snake case (see [here](http://symfony.com/doc/current/components/config/definition.html#normalization)). +Your feature "flag-a" becomes "flag_a". So you have to check for "flag_a" everywhere in your code, even if you've +actually maintained "flag-a" in your YML / XML. Consider this with your feature naming. + Constraint usage ------------------------- In some cases will you need more instead of a simple true / false. So you can define constraints to enable or disable a feature.