PHPackages                             rasuvaeff/yii3-feature-flags-ui - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. rasuvaeff/yii3-feature-flags-ui

ActiveLibrary[Admin Panels](/categories/admin)

rasuvaeff/yii3-feature-flags-ui
===============================

Admin UI panel for managing Yii3 feature flags

v1.0.0(yesterday)00BSD-3-ClausePHPPHP 8.3 - 8.5CI passing

Since Jun 19Pushed yesterdayCompare

[ Source](https://github.com/rasuvaeff/yii3-feature-flags-ui)[ Packagist](https://packagist.org/packages/rasuvaeff/yii3-feature-flags-ui)[ Docs](https://github.com/rasuvaeff/yii3-feature-flags-ui)[ RSS](/packages/rasuvaeff-yii3-feature-flags-ui/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (26)Versions (2)Used By (0)

rasuvaeff/yii3-feature-flags-ui
===============================

[](#rasuvaeffyii3-feature-flags-ui)

[![Latest Stable Version](https://camo.githubusercontent.com/a3ceb9115127d911da47a8a8cf0fab76434a63356a889563a15076f631c7fb48/68747470733a2f2f706f7365722e707567782e6f72672f7261737576616566662f796969332d666561747572652d666c6167732d75692f76)](https://packagist.org/packages/rasuvaeff/yii3-feature-flags-ui)[![Total Downloads](https://camo.githubusercontent.com/8f94e2eb473ea7cba45d05891871775c7eacece23f5dbd1ee65d3ae46d0e43b1/68747470733a2f2f706f7365722e707567782e6f72672f7261737576616566662f796969332d666561747572652d666c6167732d75692f646f776e6c6f616473)](https://packagist.org/packages/rasuvaeff/yii3-feature-flags-ui)[![Build](https://github.com/rasuvaeff/yii3-feature-flags-ui/actions/workflows/build.yml/badge.svg)](https://github.com/rasuvaeff/yii3-feature-flags-ui/actions/workflows/build.yml)[![Static analysis](https://github.com/rasuvaeff/yii3-feature-flags-ui/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/rasuvaeff/yii3-feature-flags-ui/actions/workflows/static-analysis.yml)[![Psalm level](https://camo.githubusercontent.com/68f7f31799f2b93c710b14ba3877072e7fe07ec9d7cee3fdf67e14beab3e1b6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7073616c6d2d6c6576656c5f312d626c75652e737667)](https://github.com/rasuvaeff/yii3-feature-flags-ui/actions/workflows/static-analysis.yml)[![PHP](https://camo.githubusercontent.com/52699e1eac62a2aa47d2d4c52e639adf1dfcb0c26e7ac11e52d13a9e33264bdf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7261737576616566662f796969332d666561747572652d666c6167732d75692f706870)](https://packagist.org/packages/rasuvaeff/yii3-feature-flags-ui)[![License](https://camo.githubusercontent.com/6cb285b57819f8de0acfb34923298f4f569f962544e8fe35331da2d163f4e485/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d2d332d2d436c617573652d626c75652e737667)](LICENSE.md)

Admin UI panel for managing Yii3 feature flags.

> Using an AI coding assistant? [llms.txt](llms.txt) contains a compact API reference you can share with the model.

A drop-in admin panel for [`rasuvaeff/yii3-feature-flags`](https://github.com/rasuvaeff/yii3-feature-flags): list flags in a sortable grid (with kill switch and disabled badges), create and edit them (name, enabled, rollout, salt, kill switch, environments), delete them, and emit `FlagChanged` events for audit trail / cache invalidation. Read-only providers automatically get disabled controls.

Requirements
------------

[](#requirements)

- PHP 8.3+
- `rasuvaeff/yii3-feature-flags` ^1.0 - `Flag`, `FlagProvider`, `WritableFlagProvider`
- A writable provider backend (usually `rasuvaeff/yii3-feature-flags-db` ^1.0) bound to `FlagProvider` and `WritableFlagProvider`
- `yiisoft/yii-view-renderer`, `yiisoft/router`, `yiisoft/user`
- `yiisoft/html`, `yiisoft/validator`, `yiisoft/form-model`, `yiisoft/data`, `yiisoft/yii-dataview`
- A concrete router implementation (e.g. `yiisoft/router-fastroute`) - provided by your application
- Bootstrap 5 CSS loaded by the host application (views use Bootstrap classes, no inline styles)

The list grid is rendered server-side from the application DI container (`FlagsGridFactory`), so the host does **not** need to bootstrap `WidgetFactory`.

Installation
------------

[](#installation)

```
composer require rasuvaeff/yii3-feature-flags-ui
```

Usage
-----

[](#usage)

The package ships Yii3 config-plugin wiring (`di`, `params`). Add your params to the merge chain:

```
use Rasuvaeff\Yii3FeatureFlagsUi\FlagRoutes;

return [
    FlagRoutes::PARAM_KEY => [
        'route_prefix' => '/admin/flags',
        'layout' => null,
        'views' => [
            'list' => '/abs/path/to/flags-list.php',
            'edit' => '/abs/path/to/flags-edit.php',
        ],
        'middlewares' => [
            'all' => [AuthMiddleware::class],
        ],
        // RequestBodyParser is added automatically to POST routes (store, update, delete).
        // Set 'body_parser' => false if your pipeline already applies it globally.
    ],
];
```

`layout` controls the shared wrapper. `views.list` and `views.edit` override only the corresponding templates; they do not replace the layout.

Bind the flag contracts to your provider. With `rasuvaeff/yii3-feature-flags-db` ^1.0 this is automatic — its config-plugin binds `WritableFlagProvider` and `FlagProvider`to the same `DbFlagProvider`. For a custom backend, bind them yourself:

```
use Rasuvaeff\Yii3FeatureFlags\{FlagProvider, WritableFlagProvider};
use Rasuvaeff\Yii3FeatureFlagsDb\DbFlagProvider;

return [
    FlagProvider::class => DbFlagProvider::class,
    WritableFlagProvider::class => Reference::to(FlagProvider::class),
];
```

Routes
------

[](#routes)

MethodPathActionDefault nameGET`{prefix}``Yii\List\Action``flags/list`GET`{prefix}/new``Yii\Edit\Action::new()``flags/create`GET`{prefix}/{name}/edit``Yii\Edit\Action``flags/edit`POST`{prefix}/new``Yii\Update\Action::new()``flags/store`POST`{prefix}/{name}``Yii\Update\Action``flags/update`POST`{prefix}/{name}/delete``Yii\Delete\Action``flags/delete``middlewares.{all,list,edit,create,store,update,delete}` — add middlewares per slot without forking the routes. `RequestBodyParser` is added automatically to the POST routes (store, update, delete); set `'body_parser' => false` in params to opt out.

URLs and redirects are generated through the router (`UrlGeneratorInterface`) by route name; links stay correct under any prefix or subdomain. Override `route_names` in params when your app uses a different naming convention.

### Flat-route wiring

[](#flat-route-wiring)

Wire the bundled `config/routes.php` explicitly in `configuration.php`:

```
'routes' => 'vendor/rasuvaeff/yii3-feature-flags-ui/config/routes.php',
```

The route prefix, names and middlewares are read from params (`FlagRoutes::PARAM_KEY`).

### Group-based admin panel

[](#group-based-admin-panel)

Inside a `Group` (the typical approach for a shared-prefix admin area):

```
use Rasuvaeff\Yii3FeatureFlagsUi\FlagRoutes;
use Yiisoft\Router\Group;

Group::create(prefix: '/admin')->routes(
    ...FlagRoutes::fromParams($params),
);
```

`fromParams()` reads prefix, names, middlewares and body-parser opt-out from `$params[FlagRoutes::PARAM_KEY]`, so route registration and `FlagUrls` URL generation are always in sync.

For full control over names, use `create()` directly and add matching `route_names` to params:

```
FlagRoutes::create(
    prefix: '/flags',
    names: ['list' => 'admin/flags', 'edit' => 'admin/flags/edit'],
    middlewares: ['all' => [AuthMiddleware::class]],
)
```

Authorization
-------------

[](#authorization)

The package does not enforce access control internally. Protect routes via `middlewares.all` (or per-route keys). The package provides `CurrentUser` injection for audit events only.

Public API
----------

[](#public-api)

ClassDescription`FlagRoutes`Builds the 6 routes; `fromParams($params)` for group-based panels, `create()` for full control`Yii\List\Action`GET grid of all flags, with KILLED/OFF badges`Yii\Edit\Action`GET edit form for existing flag; `::new()` for create form`Yii\Update\Action`POST validate + save; `::new()` for create; re-render on invalid`Yii\Delete\Action`POST remove flag -&gt; redirect to list`Form\FlagForm`Submitted edit input (name, enabled, rollout, salt, killSwitch, environments)`Validation\FlagFormNormalizer`Casts validated form to a `Flag``Renderer\TemplateRendererInterface`Rendering seam (testable actions)`Renderer\ViewTemplateRenderer`Default renderer over `WebViewRenderer``Event\FlagChanged`PSR-14 event after save/delete (name, operation, actor)Read-only providers
-------------------

[](#read-only-providers)

If your `FlagProvider` does not implement `WritableFlagProvider`:

- `config/routes.php` still registers all routes; runtime `instanceof` checks return 403 on POST.
- List view shows a "Read-only provider" badge and the create button is hidden.
- Edit view disables all fields and shows a warning.

This lets `ConfigFlagProvider` (config-only flags) be browsed in the UI without write support.

Security
--------

[](#security)

ConcernBehaviourRead-only providers`Update`/`Delete` rejected with HTTP 403Unknown flag name`Edit` returns 404, `Update`/`Delete` return 404Invalid inputRe-renders the edit page with HTTP 200, no writeFlag name injectionOn edit existing, the submitted `name` is ignored; the route name is pinnedKill switch warningThe edit form always renders the warning; users cannot disable the warningCSRFEnforced by your application middleware; the form emits a hidden `_csrf` field when a `csrf_token` request attribute is presentOutputAll values pass through `Yiisoft\Html\Html::encode()` / Html widgets / GridView encodingCustomising views
-----------------

[](#customising-views)

Override `views.list` and/or `views.edit` in params with absolute paths to your own templates. The templates receive the same variables as the bundled ones — see `resources/views/`.

The edit form uses input names scoped under `Flag[...]` (e.g. `Flag[name]`, `Flag[enabled]`). Custom edit templates must preserve this scope for `FlagForm::fromParsedBody()` to work.

**Flash messages** are not built in — the package does not know about the host app's session. Subscribe to `FlagChanged` in your app to add flash notifications, cache invalidation, or audit trail entries.

Why `FlagChanged` Exists
------------------------

[](#why-flagchanged-exists)

The package emits `FlagChanged` after save/delete so the host app can react without coupling itself to the UI actions. Typical uses are cache invalidation, audit logging, metrics counters, and dependent reconfiguration. The `actor` field carries the current user ID; `null` for guests.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0812d5572a7041dfe36e222d295b2e6dc55833a605350fcde58a51a5965ed30?d=identicon)[rasuvaeff](/maintainers/rasuvaeff)

---

Top Contributors

[![rasuvaeff](https://avatars.githubusercontent.com/u/1352718?v=4)](https://github.com/rasuvaeff "rasuvaeff (2 commits)")

---

Tags

uiadminyii3feature-flags

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rasuvaeff-yii3-feature-flags-ui/health.svg)

```
[![Health](https://phpackages.com/badges/rasuvaeff-yii3-feature-flags-ui/health.svg)](https://phpackages.com/packages/rasuvaeff-yii3-feature-flags-ui)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[typo3/cms-core

TYPO3 CMS Core

3312.9M4.8k](/packages/typo3-cms-core)[yiisoft/app

Yii3 web application template

36913.9k](/packages/yiisoft-app)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
