Skip to content
A simple feature toggle bundle for syfmony2 and twig
PHP
Find file
Pull request Compare This branch is 1 commit ahead, 5 commits behind marekkalnik:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
DependencyInjection
Exception
Feature
Resources
Templating/Helper
Tests
Twig
vendor
.gitignore
.travis.yml
FeatureToggleBundle.php
README.md
composer.json
phpunit.xml.dist

README.md

EmkaFeatureToggleBundle

This bundle helps you easily configure your feature toggling in Symfony2 by adding some simple tags to php twig and extending it's configuration.

It's under developement, and it's not usable at this moment.

Configuring your features

You could add to your config.yml the following lines:

feature_toggle:
    features:
        my_feature:
            name: my_feature # the name you use in your template
            enabled: true    # false

Use feature toggling in your templates

Once you configured your features, you can surround it with the featureblock in your Twig templates.

{% feature 'my_feature' %}
  {% if true %}
    ... add you code
  {% endif %}
{% endfeature %}
Something went wrong with that request. Please try again.