kukulili-labs / feature-toggle-bundle
A bundle to manage feature toggles.
Installs: 17 377
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: ~2.1
Requires (Dev)
- symfony/yaml: ~2.1
- twig/twig: ~1.5
This package is not auto-updated.
Last update: 2024-12-16 17:16:59 UTC
README
A bundle to manage feature toggles.
This Bundle is inspired by the SoclozFeatureFlagBundle.
Installation
Install package with composer
"kukulili-labs/feature-toggle-bundle": "dev-master"
Register bundles in AppKernel
new KukuliliLabs\FeatureToggleBundle\KukuliliLabsFeatureToggleBundle(),
Configuration
The basic configuration is:
# app/config/config.yml kukulili_labs_feature_toggle: feature_toggles: feature_toggles_name: # change it to the name of your feature toggle state: enabled # change to disabled for disable your feature toggle description: # this option is optional and will be used later
Using
Controller
if ($this->get('kukulili_labs_feature_toggle.feature_toggles')->isEnabled('feature_toggles_name')) {...}
Twig
{% if feature_toggle_is_enabled('feature_toggles_name') %} ... {% endif %}
Dis-/Enabling a specific feature toggle on a session
$this->get('kukulili_labs_feature_toggle.feature_toggles')->disableForSession('feature_toggles_name'); $this->get('kukulili_labs_feature_toggle.feature_toggles')->enableForSession('feature_toggles_name');
License
This bundle is released under the MIT license (see LICENSE).