Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazy252/typo3_features
Feature Flags with an UI for TYPO3
https://github.com/crazy252/typo3_features
composer feature-flags typo3 typo3-extension
Last synced: 25 days ago
JSON representation
Feature Flags with an UI for TYPO3
- Host: GitHub
- URL: https://github.com/crazy252/typo3_features
- Owner: crazy252
- License: gpl-3.0
- Created: 2024-07-29T18:04:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-07-29T18:39:19.000Z (3 months ago)
- Last Synced: 2024-09-30T22:40:43.918Z (about 1 month ago)
- Topics: composer, feature-flags, typo3, typo3-extension
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TYPO3 Feature Flags
Introducing the new open-source package for TYPO3, designed to streamline feature management through the use of feature flags. This package empowers developers and site administrators with a flexible and intuitive backend interface for creating and managing feature flags, enabling granular control over feature deployments. Whether you're rolling out new features incrementally, running A/B tests, or customizing user experiences, our package supports both standard and custom flags, offering a robust solution for feature toggling directly within TYPO3. Unlock seamless feature control and ensure your site's features are deployed smoothly and efficiently.
## Setup
Installtion via composer
```shell
composer require crazy252/typo3_features
```## Usage
You can use the original features core class from TYPO3. This class is extended by this package with a lot of new features.
```php
use TYPO3\CMS\Core\Configuration\Features;$features = GeneralUtility::makeInstance(Features::class);
$isFeatureEnabled = $features->isFeatureEnabled('dummy-feature');
```### Multiple features
You can also check multiple features if you want.
```php
$isFeatureEnabled = $features->isFeatureEnabled('dummy-feature,other-feature');
```### Own feature class
You can also create your own logic for the feature check by adding the class namespace in the backend feature. After the feature is created in the backend, you can create a feature class with the interface from the package
```php
namespace Vendor\Extension\Features;class DummyFeature implements \Crazy252\Typo3Features\Contracts
{
public function verdict(): bool
{
// Custom feature check
}
}
```### Feature ViewHelper
This package gives also an viewhelper to check for features in the template. TYPO3 13.1 has an viewhelper for this. Before that, we backport the viewhelper to older versions.
```xml
This is being shown if the flag is enabled
This is being shown if both flags are enabled
```
## Usage (TYPO3 9.0 or below)
You need to use the legecy class for features which can be replaced in higher versions easily with the feature core class.
```php
use Crazy252\Typo3Features\Legacy\Features;$features = GeneralUtility::makeInstance(Features::class);
$isFeatureEnabled = $features->isFeatureEnabled('dummy-feature');
```