lwiesel/feature-checker-bundle
最新稳定版本:v1.1.0
Composer 安装命令:
composer require lwiesel/feature-checker-bundle
包简介
Enable and disable functional features in Symfony2 applications.
README 文档
README
Define features, and check if they are activated or not in your Symfony2 application.
Usage
Define a feature configuration in your config.yml.
# app/config/config.yml feature_checker: features: feature1: true feature2: false feature3: feature31: true feature32: true
Then use the features names in controller annotations. Only the allowed features will execute the action.
<?php // src/AppBundle/Controller/DefaultController.php namespace AppBundle\Controller; use LWI\FeatureCheckerBundle\Annotations\MustHaveFeature; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { /** * @MustHaveFeature("feature1") */ public function indexAction() { return $this->render('default/index.html.twig'); } }
Sub-features can be checked with this notation:
/** * @MustHaveFeature("feature1") * @MustHaveFeature("feature3.feature31") */ public function secondAction() { return $this->render('default/second.html.twig'); }
You can also test whole feature sets. A feature set is considered enabled when all sub-features -at any sub-level- is enabled.
/** * @MustHaveFeature("feature3") */ public function thirdAction() { return $this->render('default/third.html.twig'); } }
Installation
Please see Full documentation for details.
Testing
$ bin/phpspec run
Contributing
Please see CONTRIBUTING for details.
Changelog
Please see CHANGELOG for details.
Security
If you discover any security related issues, please email wiesel.laurent@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 225
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-25